{"id":108826,"date":"2026-06-06T10:11:36","date_gmt":"2026-06-06T07:11:36","guid":{"rendered":"https:\/\/vpesports.com\/minecraft\/mods\/natsbridge\/"},"modified":"2026-06-06T10:11:36","modified_gmt":"2026-06-06T07:11:36","slug":"natsbridge","status":"publish","type":"mod","link":"https:\/\/vpesports.com\/minecraft\/mods\/natsbridge\/","title":{"rendered":"NatsBridge"},"content":{"rendered":"<p># NatsBridge<\/p>\n<p>**NatsBridge** is a Java library that connects your **Spigot**, **Velocity**, or **BungeeCord** plugins to a **NATS** server \u2014 easily and efficiently.<\/p>\n<p>## \ud83d\ude80 Features<\/p>\n<p>* \u2705 Shared NATS **connection** across plugins<br \/>\n* \u2705 Supports **Spigot\/Paper**, **Velocity**, and **BungeeCord**<br \/>\n* \u2705 **High-performance Consumer API** for message handling<br \/>\n* \u2705 Clean API to **publish** messages<br \/>\n* \u2705 **Auto-reconnect** &#038; error handling<br \/>\n* \u2705 **YAML configuration**<br \/>\n* \u2705 TLS &#038; authentication support<br \/>\n* \u2705 Sync &#038; async message handling<\/p>\n<p>## \ud83d\udce6 Setup<\/p>\n<p>1. **Download** the JAR:<\/p>\n<p>2. Drop it into your server\u2019s `\/plugins` folder.<\/p>\n<p>3. Start the server. A `nats-config.yml` file will be generated.<\/p>\n<p>4. Edit the config file and restart.<\/p>\n<p>## \u2699\ufe0f Usage Example<\/p>\n<p>### Using high-performance Consumer API<\/p>\n<p>&#8220;`java<br \/>\n\/\/ Sync consumer<br \/>\nNatsAPI api = BungeeCordNatsPlugin.getNatsAPI();<br \/>\napi.subscribeSubject(&#8220;game.player.join&#8221;, message -> {<br \/>\n    String playerName = new String(message, StandardCharsets.UTF_8);<br \/>\n    System.out.println(&#8220;Player joined: &#8221; + playerName);<br \/>\n}, false);<\/p>\n<p>\/\/ Async consumer (byte[])<br \/>\napi.subscribeSubject(&#8220;game.chat&#8221;, message -> {<br \/>\n    \/\/ Process chat message asynchronously<br \/>\n    String chatMessage = new String(message, StandardCharsets.UTF_8);<br \/>\n    broadcastToAllServers(chatMessage);<br \/>\n}, true);<\/p>\n<p>\/\/ Async consumer (String) &#8211; more convenient!<br \/>\napi.subscribeStringSubject(&#8220;game.chat&#8221;, chatMessage -> {<br \/>\n    \/\/ Directly receive as String &#8211; no need for manual conversion<br \/>\n    broadcastToAllServers(chatMessage);<br \/>\n}, true);<br \/>\n&#8220;`<\/p>\n<p>### Publish a message<\/p>\n<p>Firstly you need to know when the connection is established.<br \/>\nThere are 3 events for Velocity, Bungeecord and Spigot.<br \/>\n&#8211; VelocityNatsBridgeConnectedEvent<br \/>\n&#8211; BungeeNatsBridgeConnectedEvent<br \/>\n&#8211; SpigotNatsBridgeConnectedEvent<\/p>\n<p>Something like<br \/>\n&#8220;`java<br \/>\n@EventHandler<br \/>\npublic void onNatsBridgeConnected(SpigotNatsBridgeConnectedEvent event) {<br \/>\n    \/\/Do something here<br \/>\n}<br \/>\n&#8220;`<\/p>\n<p>You just need to listen these events and the event is fire when the connection to NATS is up.<\/p>\n<p>&#8220;`java<br \/>\nBungeeCordNatsPlugin.getNatsAPI().publishString(&#8220;subject&#8221;, &#8220;Awesome message&#8221;);<br \/>\nBungeeCordNatsPlugin.getNatsAPI().publishRaw(&#8220;subject&#8221;, [something that is byte[]]);<br \/>\n&#8220;`<\/p>\n<p>## \ud83d\udcc2 Configuration (`nats-config.yml`)<\/p>\n<p>&#8220;`yaml<br \/>\nnats:<br \/>\n  # List of NATS servers (can be a single server or a cluster)<br \/>\n  servers:<br \/>\n    &#8211; &#8220;nats:\/\/127.0.0.1:4222&#8221;<br \/>\n    &#8211; &#8220;nats:\/\/nats-cluster.local:4222&#8221;<\/p>\n<p>  # Authentication configuration (optional)<br \/>\n  auth:<br \/>\n    enabled: true<br \/>\n    # Username\/password authentication<br \/>\n    username: &#8220;user&#8221;<br \/>\n    password: &#8220;pass&#8221;<br \/>\n    # OR token authentication (if provided, username\/password are ignored)<br \/>\n    # token: &#8220;your_token_here&#8221;<\/p>\n<p>  # TLS configuration (optional)<br \/>\n  tls:<br \/>\n    enabled: false<br \/>\n    # Paths to keystores (optional)<br \/>\n    # keystore: &#8220;\/path\/to\/keystore.jks&#8221;<br \/>\n    # keystore_password: &#8220;keystore_password&#8221;<br \/>\n    # truststore: &#8220;\/path\/to\/truststore.jks&#8221;<br \/>\n    # truststore_password: &#8220;truststore_password&#8221;<\/p>\n<p>  # Reconnection configuration<br \/>\n  reconnect:<br \/>\n    # Maximum number of reconnection attempts (-1 = unlimited)<br \/>\n    max_reconnects: -1<br \/>\n    # Delay between reconnection attempts (in milliseconds)<br \/>\n    reconnect_wait: 2000<br \/>\n    # Connection timeout (in milliseconds)<br \/>\n    connection_timeout: 5000<br \/>\n&#8220;`<\/p>\n<p>## \ud83d\udd27 Commands<\/p>\n<p>* `\/nats help` \u2013 Show help menu<br \/>\n* `\/nats status` \u2013 Check NATS connection status<br \/>\n* `\/nats test <subject> <message>` \u2013 Send a test message<br \/>\n* `\/nats reload` \u2013 Reload NATS configuration (planned)<\/p>\n<p>Permission required: `natsbridge.admin`<\/p>\n<p>## \ud83e\udde9 Gradle<\/p>\n<p>&#8220;`gradle<br \/>\nrepositories {<br \/>\n    maven {<br \/>\n        name = &#8220;natsbridge-repo&#8221;<br \/>\n        url = uri(&#8220;https:\/\/repo.nhsoul.fr\/releases&#8221;)<br \/>\n    }<br \/>\n}<br \/>\ndependencies {<br \/>\n    \/\/Use the latest version<\/p>\n<p>    \/\/ Mandatory<br \/>\n    compileOnly(&#8220;fr.nhsoul.natsbridge:core:1.0.0&#8221;)<br \/>\n    compileOnly(&#8220;fr.nhsoul.natsbridge:common:1.0.0&#8221;)<\/p>\n<p>    \/\/Select your platform<br \/>\n    compileOnly(&#8220;fr.nhsoul.natsbridge:spigot:1.0.0&#8221;)<br \/>\n    compileOnly(&#8220;fr.nhsoul.natsbridge:velocity:1.0.0&#8221;)<br \/>\n    compileOnly(&#8220;fr.nhsoul.natsbridge:bungeecord:1.0.0&#8221;)<br \/>\n}<br \/>\n&#8220;`<\/p>\n<p>## \ud83e\udde9 Performance Considerations<\/p>\n<p>The Consumer API approach offers several advantages:<\/p>\n<p>1. **No reflection overhead**: Native performance for message handling.<br \/>\n2. **Type safety**: Use of standard Java interfaces.<br \/>\n3. **Explicit control**: You control exactly when and how messages are processed.<br \/>\n4. **Platform integration**: Easy access to platform-specific APIs (Spigot, Velocity, BungeeCord).<\/p>\n<p>## \u2705 Requirements<\/p>\n<p>* Java 21+<br \/>\n* A NATS server<br \/>\n* Minecraft 1.20+ server (Spigot, Velocity, or BungeeCord)<\/p>\n<p>## \ud83e\udd1d Contributing<\/p>\n<p>1. Fork this repo<br \/>\n2. Create a branch<br \/>\n3. Submit a PR \u2013 all contributions welcome!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>NATS messaging library for Minecraft servers<\/p>\n","protected":false},"featured_media":108827,"template":"","meta":{"_minecraft_slug":"natsbridge","_minecraft_project_id":"oIAQLwUD","_minecraft_author":"NhPro","_minecraft_license":"LicenseRef-Dual-License","_minecraft_downloads":13,"_minecraft_follows":0,"_minecraft_client_side":"unsupported","_minecraft_server_side":"required","_minecraft_storage_type":"zip","_minecraft_archive_name":"natsbridge.zip","_minecraft_size_bytes":610531,"_minecraft_version_count":1,"_minecraft_updated_at":"2026-05-15T22:58:47.683033Z","_minecraft_date_created":"2026-01-05T23:12:14.498971Z","_minecraft_date_modified":"2026-01-04T17:12:16.460990Z","_minecraft_project_url":"https:\/\/modrinth.com\/mod\/natsbridge","_minecraft_icon_attachment_id":108827,"_minecraft_imported_at":"2026-06-06T07:11:37+00:00","_minecraft_import_hash":"5e84e373a897ad618ca5b3070bd135f4","_minecraft_versions":"","_minecraft_links":"","_minecraft_gallery":"","_minecraft_api_metadata":""},"mod_category":[124,894,125,873,126,127,128,129,92,985,992],"mod_loader":[130,895,131,132,133,134,986,993],"minecraft_version":[59,36,60,93,94,101,102,62,37,40,41,73,74,38,78,79,80,81,82],"class_list":["post-108826","mod","type-mod","status-publish","has-post-thumbnail","hentry","mod_category-bukkit","mod_category-bungeecord","mod_category-folia","mod_category-library","mod_category-management","mod_category-paper","mod_category-purpur","mod_category-spigot","mod_category-utility","mod_category-velocity","mod_category-waterfall","mod_loader-bukkit","mod_loader-bungeecord","mod_loader-folia","mod_loader-paper","mod_loader-purpur","mod_loader-spigot","mod_loader-velocity","mod_loader-waterfall","minecraft_version-1-20","minecraft_version-1-20-1","minecraft_version-1-20-2","minecraft_version-1-20-3","minecraft_version-1-20-4","minecraft_version-1-20-5","minecraft_version-1-20-6","minecraft_version-1-21","minecraft_version-1-21-1","minecraft_version-1-21-10","minecraft_version-1-21-11","minecraft_version-1-21-2","minecraft_version-1-21-3","minecraft_version-1-21-4","minecraft_version-1-21-5","minecraft_version-1-21-6","minecraft_version-1-21-7","minecraft_version-1-21-8","minecraft_version-1-21-9"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>NatsBridge - Minecraft<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/vpesports.com\/minecraft\/mods\/natsbridge\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"NatsBridge - Minecraft\" \/>\n<meta property=\"og:description\" content=\"NATS messaging library for Minecraft servers\" \/>\n<meta property=\"og:url\" content=\"https:\/\/vpesports.com\/minecraft\/mods\/natsbridge\/\" \/>\n<meta property=\"og:site_name\" content=\"Minecraft\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/natsbridge\\\/\",\"url\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/natsbridge\\\/\",\"name\":\"NatsBridge - Minecraft\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/natsbridge\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/natsbridge\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/natsbridge-icon-ec73c59ed0540d78e1808d39eeddba8aa938c9a9_96.webp\",\"datePublished\":\"2026-06-06T07:11:36+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/natsbridge\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/natsbridge\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/natsbridge\\\/#primaryimage\",\"url\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/natsbridge-icon-ec73c59ed0540d78e1808d39eeddba8aa938c9a9_96.webp\",\"contentUrl\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/natsbridge-icon-ec73c59ed0540d78e1808d39eeddba8aa938c9a9_96.webp\",\"width\":96,\"height\":96},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/natsbridge\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Mods\",\"item\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"NatsBridge\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/#website\",\"url\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/\",\"name\":\"Minecraft\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"NatsBridge - Minecraft","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/vpesports.com\/minecraft\/mods\/natsbridge\/","og_locale":"en_US","og_type":"article","og_title":"NatsBridge - Minecraft","og_description":"NATS messaging library for Minecraft servers","og_url":"https:\/\/vpesports.com\/minecraft\/mods\/natsbridge\/","og_site_name":"Minecraft","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/vpesports.com\/minecraft\/mods\/natsbridge\/","url":"https:\/\/vpesports.com\/minecraft\/mods\/natsbridge\/","name":"NatsBridge - Minecraft","isPartOf":{"@id":"https:\/\/vpesports.com\/minecraft\/#website"},"primaryImageOfPage":{"@id":"https:\/\/vpesports.com\/minecraft\/mods\/natsbridge\/#primaryimage"},"image":{"@id":"https:\/\/vpesports.com\/minecraft\/mods\/natsbridge\/#primaryimage"},"thumbnailUrl":"https:\/\/vpesports.com\/minecraft\/wp-content\/uploads\/2026\/06\/natsbridge-icon-ec73c59ed0540d78e1808d39eeddba8aa938c9a9_96.webp","datePublished":"2026-06-06T07:11:36+00:00","breadcrumb":{"@id":"https:\/\/vpesports.com\/minecraft\/mods\/natsbridge\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/vpesports.com\/minecraft\/mods\/natsbridge\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/vpesports.com\/minecraft\/mods\/natsbridge\/#primaryimage","url":"https:\/\/vpesports.com\/minecraft\/wp-content\/uploads\/2026\/06\/natsbridge-icon-ec73c59ed0540d78e1808d39eeddba8aa938c9a9_96.webp","contentUrl":"https:\/\/vpesports.com\/minecraft\/wp-content\/uploads\/2026\/06\/natsbridge-icon-ec73c59ed0540d78e1808d39eeddba8aa938c9a9_96.webp","width":96,"height":96},{"@type":"BreadcrumbList","@id":"https:\/\/vpesports.com\/minecraft\/mods\/natsbridge\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/vpesports.com\/minecraft\/"},{"@type":"ListItem","position":2,"name":"Mods","item":"https:\/\/vpesports.com\/minecraft\/mods\/"},{"@type":"ListItem","position":3,"name":"NatsBridge"}]},{"@type":"WebSite","@id":"https:\/\/vpesports.com\/minecraft\/#website","url":"https:\/\/vpesports.com\/minecraft\/","name":"Minecraft","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/vpesports.com\/minecraft\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/mod\/108826","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/mod"}],"about":[{"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/types\/mod"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/media\/108827"}],"wp:attachment":[{"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/media?parent=108826"}],"wp:term":[{"taxonomy":"mod_category","embeddable":true,"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/mod_category?post=108826"},{"taxonomy":"mod_loader","embeddable":true,"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/mod_loader?post=108826"},{"taxonomy":"minecraft_version","embeddable":true,"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/minecraft_version?post=108826"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}