Difference between revisions of "Plugin channels"

From wiki.vg
Jump to navigation Jump to search
(→‎MC|DebugNeighborsUpdate: 1.11.2's new channel)
(15 intermediate revisions by 5 users not shown)
Line 2: Line 2:
 
{{anchor|Internal}}
 
{{anchor|Internal}}
 
== Reserved channels ==
 
== Reserved channels ==
=== <code>REGISTER</code> ===
+
=== <code>minecraft:register</code> ===
 
''Two-way''
 
''Two-way''
  
 
Allows the client or server to register for one or more custom channels, indicating that data should be sent on those channels if the receiving end supports it too. Payload is a null (<code>0x00</code>) separated list of strings.
 
Allows the client or server to register for one or more custom channels, indicating that data should be sent on those channels if the receiving end supports it too. Payload is a null (<code>0x00</code>) separated list of strings.
  
=== <code>UNREGISTER</code> ===
+
This channel was [https://twitter.com/Dinnerbone/status/1012052979250319360 renamed] from <code>REGISTER</code> in 1.13.
 +
 
 +
=== <code>minecraft:unregister</code> ===
 
''Two-way''
 
''Two-way''
  
 
Allows the client or server to unregister from one or more custom channels, indicating that the receiving end should stop sending data on those channels. Payload is a null-separated list of strings. This is only useful if plugins are disabled/unloaded while the client is connected.
 
Allows the client or server to unregister from one or more custom channels, indicating that the receiving end should stop sending data on those channels. Payload is a null-separated list of strings. This is only useful if plugins are disabled/unloaded while the client is connected.
 +
 +
This channel was [https://twitter.com/Dinnerbone/status/1012052979250319360 renamed] from <code>UNREGISTER</code> in 1.13.
  
 
== Channels internal to Minecraft ==
 
== Channels internal to Minecraft ==
Since 1.3, Minecraft itself uses several plugin channels to implement new features. These internal channel names are prefixed by <code>MC|</code>. They are '''not''' formally registered using the REGISTER channel. The vanilla Minecraft server will send these packets regardless, and the vanilla client will accept them.
+
Since 1.3, Minecraft itself uses several plugin channels to implement new features. These internal channels use the <code>minecraft</code> namespace. They are '''not''' formally registered using the register channel. The vanilla Minecraft server will send these packets regardless, and the vanilla client will accept them.
 +
 
 +
Note that there were originally more channels included, but most of these were removed in 1.13.  See [https://wiki.vg/index.php?title=Plugin_channels&oldid=14089 this revision of the article] for the original list.
 +
 
 +
=== <code>minecraft:brand</code> ===
 +
''Two-way''
 +
 
 +
Announces the server and client implementation name right after a player has logged in. For the Notchian client and server server, this is "vanilla" (which is chosen using the Function <code>net.minecraft.client.ClientBrandRetriever.getClientModName()</code>) (encoded as a [[Data Types|protocol string]]: a UTF-8 string with the length prefixed as a VarInt).
 +
 
 +
These brands are used in crash reports and a few other locations; it's recommended that custom clients and servers use changed brands for the purpose of identification (for the Notchian client, the class used to get the brand is one of the few non-obfuscated classes).  The brand is not processed in any other way, and Notchian clients will connect to servers with changed brands with no issue (the brand is not used to validate).
  
=== <code>MC|AdvCmd</code> ===
+
The Notchian server sends a <code>minecraft:brand</code> packet right after it sends a [[Protocol#Join_Game|Join Game]] packet, and the Notchian client sends it right after receiving a Join Game packet. However, some modified clients and servers will not send this packet (or will take longer to send it than normal), so it is important to not crash if the brand has not been sent.  Additionally, the brand may change at any time (for instance, if connected through a BungeeCord instance, you may switch from a server with one brand to a server with another brand without receiving a Join Game packet).
{{anchor|MC.7CAdvCdm}}''Client to server''
 
  
Sets the contents of a command block or command block Minecart.  The Notchain client only uses this for command block minecarts and uses [[#MC.7CAutoCmd|<code>MC|AutoCmd</code>]] for blocks, but the Notchian server still accepts it for either.
+
=== <code>minecraft:book_open</code> ===
 +
''Server to client''
  
In 1.8 and earlier the name of this channel was incorrectly spelled as <code>MC|AdvCdm</code>.  This was fixed in snapshot {{Minecraft Wiki|15w34a}}.
+
When a player right clicks with a signed book. This tells the client to open the book GUI.
  
The packet starts with a single byte, which determines the type of thing being edited (block or minecart).  If it is 0, then it is a block and the location is 3 ints; if it is 1, then it is a minecart and the location is the entity's EID as an int.
+
The payload is a VarInt enum for the selected hand: 0 for the main hand, 1 for the offhand.
  
; type = 0
+
=== <code>minecraft:trader_list</code> ===
 +
''Server to client''
 +
 
 +
The list of trades a villager NPC is offering.
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Type !! Field Name !! Field Type !! Notes
+
  ! colspan="2" | Field Name
 +
! colspan="2" | Field Type
 +
! Notes
 
  |-
 
  |-
  | rowspan=6 | 0x00
+
  | colspan="2" | Window ID
  | X || Int ||  
+
  | colspan="2" | Int
 +
| The ID of the window that is open; this is an int rather than a byte.
 +
|-
 +
| colspan="2" | Size
 +
| colspan="2" | Byte
 +
| The number of trades in the following array
 
  |-
 
  |-
  | Y || Int ||  
+
  | rowspan="7" | Trades
 +
| Input item 1
 +
| rowspan="7" | Array
 +
| Slot
 +
| The first item the villager is buying
 
  |-
 
  |-
  | Z || Int ||  
+
  | Output item
 +
| Slot
 +
| The item the villager is selling
 
  |-
 
  |-
  | Command || String ||
+
  | Has second item
 +
| Boolean
 +
| Whether there is a second item
 
  |-
 
  |-
  | Track Output || Boolean ||
+
  | Input item 2
  |}
+
| Optional slot
 
+
  | The second item the villager is buying; only present if they have a second item.
; type = 1
 
 
 
{| class="wikitable"
 
! Type !! Field Name !! Field Type !! Notes
 
 
  |-
 
  |-
  | rowspan=3 | 0x01
+
  | Trade disabled
  | Entity ID || Int || 
+
| Boolean
 +
  | True if the trade is disabled; false if the trade is enabled.
 
  |-
 
  |-
  | Command || String ||
+
  | Number of trade uses
 +
| Int
 +
| Number of times the trade has been used so far
 
  |-
 
  |-
  | Track Output || Boolean ||
+
  | Maximum number of trade uses
 +
| Int
 +
| Number of times this trade can be used
 
  |}
 
  |}
  
=== <code>MC|AutoCmd</code> ===
+
=== <code>minecraft:debug/paths</code> ===
''Client to server''
 
 
 
Sets command block contents.  This can only be used to edit command blocks; command block minecarts cannot be used with it.  To edit a command block minecart, use [[#MC.7CAdvCmd|<code>MC|AdvCmd</code>]].
 
 
 
{| class="wikitable"
 
! Field Name !! Field Type !! Notes
 
|-
 
| X || Int ||
 
|-
 
| Y || Int ||
 
|-
 
| Z || Int ||
 
|-
 
| Command || String ||
 
|-
 
| Track output || Boolean || If false, the output of the previous command will not be stored within the command block.
 
|-
 
| Mode || String enum || One of "SEQUENCE", "AUTO", and "REDSTONE"
 
|-
 
| Is conditional || Boolean ||
 
|-
 
| Automatic || Boolean ||
 
|}
 
 
 
=== <code>MC|BEdit</code> ===
 
''Client to server''
 
 
 
When a player edits an unsigned book.
 
 
 
This payload is simply a set of bytes corresponding to a [[Slot Data|Slot]].
 
 
 
The [[NBT]] section of the Slot contains
 
 
 
<pre>
 
TAG_Compound(<nowiki>''</nowiki>): 1 entry
 
{
 
  TAG_List('pages'): 2 entries
 
  {
 
    TAG_String(0): 'Something on Page 1'
 
    TAG_String(1): 'Something on Page 2'
 
  }
 
}
 
</pre>
 
 
 
=== <code>MC|BOpen</code> ===
 
''Server to client''
 
 
 
When a player right clicks with a signed book. This tells the client to open the book GUI.
 
 
 
The payload is a VarInt enum for the selected hand: 0 for the main hand, 1 for the offhand.
 
 
 
=== <code>MC|BSign</code> ===
 
''Client to server''
 
 
 
When a player signs a book.
 
 
 
This payload is simply a set of bytes corresponding to a [[Slot Data|Slot]].
 
 
 
The Item ID in the Slot should be a Written Book
 
 
 
The [[NBT]] section of the Slot contains
 
 
 
<pre>
 
TAG_Compound(<nowiki>''</nowiki>): 3 entires
 
{
 
  TAG_String('author'): 'Steve'
 
  TAG_String('title'): 'A Wonderful Book'
 
  TAG_List('pages'): 2 entries
 
  {
 
    TAG_String(0): 'Something on Page 1'
 
    TAG_String(1): 'Something on Page 2'
 
  }
 
}
 
</pre>
 
 
 
=== <code>MC|Beacon</code> ===
 
''Client to server''
 
 
 
Two integers corresponding to the 2 effects a user wishes to have active.
 
 
 
=== <code>MC|Brand</code> ===
 
''Two-way''
 
 
 
Announces the server and client implementation name right after a player has logged in. For the Notchian client and server server, this is "vanilla" (encoded as a [[Data Types|protocol string]]: a UTF-8 string with the length prefixed as a VarInt).
 
 
 
These brands are used in crash reports and a few other locations; it's recommended that custom clients and servers use changed brands for the purpose of identification (for the Notchian client, the class used to get the brand is one of the few non-obfuscated classes).  The brand is not processed in any other way, and Notchian clients will connect to servers with changed brands with no issue (the brand is not used to validate).
 
 
 
The Notchian server sends a <code>MC|Brand</code> packet right after it sends a [[Protocol#Join_Game|Join Game]] packet, and the Notchian client sends it right after receiving a Join Game packet.  However, some modified clients and servers will not send this packet (or will take longer to send it than normal), so it is important to not crash if the brand has not been sent.  Additionally, the brand may change at any time (for instance, if connected through a BungeeCord instance, you may switch from a server with one brand to a server with another brand without receiving a Join Game packet).
 
 
 
=== <code>MC|DebugPath</code> ===
 
 
''Server to client''
 
''Server to client''
  
[[File:MC-DebugPath_in_16w14a.png|thumb|What appears to be the purpose of <code><nowiki>MC|DebugPath</nowiki></code> as seen in the [http://mojang.com/2016/04/minecraft-snapshot-16w14a/ snapshot 16w14a announcement].  This is ''not'' found in the normal game.]]
+
[[File:MC-DebugPath_in_16w14a.png|thumb|What appears to be the purpose of <code><nowiki>minecraft:debug/paths</nowiki></code> as seen in the [http://mojang.com/2016/04/minecraft-snapshot-16w14a/ snapshot 16w14a announcement].  This is ''not'' found in the normal game.]]
  
 
Never sent, but does something with pathfinding debugging.  The client reads the data and stores it, but its renderer cannot be enabled without modifications.
 
Never sent, but does something with pathfinding debugging.  The client reads the data and stores it, but its renderer cannot be enabled without modifications.
Line 186: Line 128:
 
  | Number of points
 
  | Number of points
 
  | Int
 
  | Int
  | Length of the following array
+
  | Number of elements in the following array
 
  |-
 
  |-
 
  | Points array
 
  | Points array
Line 194: Line 136:
 
  | Open set length
 
  | Open set length
 
  | Int
 
  | Int
  | Length of the following array
+
  | Number of elements in the following array
 
  |-
 
  |-
 
  | Open set
 
  | Open set
Line 202: Line 144:
 
  | Closed set length
 
  | Closed set length
 
  | Int
 
  | Int
  | Length of the following array
+
  | Number of elements in the following array
 
  |-
 
  |-
 
  | Closed set
 
  | Closed set
Line 273: Line 215:
 
* 16: DOOR_IRON_CLOSED
 
* 16: DOOR_IRON_CLOSED
  
=== <code>MC|DebugNeighborsUpdate</code> ===
+
=== <code>minecraft:debug/neighbors_update</code> ===
 
''Server to client''
 
''Server to client''
  
Line 284: Line 226:
 
  |-
 
  |-
 
  | Time
 
  | Time
  | Long
+
  | VarLong
 
  | World timestamp at which the update occurred.  200 ticks after this timestamp, the given update stops rendering.
 
  | World timestamp at which the update occurred.  200 ticks after this timestamp, the given update stops rendering.
 
  |-
 
  |-
Line 292: Line 234:
 
  |}
 
  |}
  
=== <code>MC|ItemName</code> ===
+
=== <code>minecraft:debug/caves</code> ===
''Client to server''
 
  
Sent as a player is renaming an item in an anvil (each keypress in the anvil UI sends a new <code>MC|ItemName</code> packet).  The payload is optional, and if not sent (IE, the length of the packet is 0 bytes) or if the new name is empty, then the item loses its custom name (this is different from setting the custom name to the normal name of the item)The item name may be no longer than 30 characters long, and if it is longer than that, then the rename is silently ignored.
+
Never sent, but (presumably) used to debug cavesDoes not render without modifying the client.
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Field name
+
  !colspan="2"| Field name
  ! Field type
+
  !colspan="2"| Field type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  | Item name
+
  |colspan="2"| Cave position
| Optional String
+
  |colspan="2"| Position
  | The new name of the item
+
  | Rendered as a white cube; also used to determine the color of the other parts.
|}
+
  |-
 
+
|colspan="2"| Count
=== <code>MC|PickItem</code> ===
+
  |colspan="2"| Int
''Client to server''
+
  | Number of elements in the following array
 
 
Used to swap out an empty space on the hotbar with the item in the given inventory slot. The Notchain client uses this for pick block functionality (middle click) to retrieve items from the inventory.
 
 
 
Payload is a single varint, which is the slot in the inventory to grab from.
 
 
 
The server will first search the player's hotbar for an empty slot, starting from the current slot and looping around to the slot before it. If there are no empty slots, it will start a second search from the current slot and find the first slot that does not contain an enchanted item.  If there still are no slots that meet that criteria, then the server will use the currently selected slot.
 
 
 
After finding the appropriate slot, the server swaps the items and then send 3 packets:
 
 
 
* [[Protocol#Set slot|Set Slot]], with window ID set to -2 and slot set to the newly chosen slot and the item set to the item that is now in that slot (which was previously at the slot the client requested)
 
* Set Slot, with window ID set to -2 and slot set to the slot the player requested, with the item that is now in that slot and was previously on the hotbar slot
 
* [[Protocol#Held_Item_Change_.28clientbound.29|Held Item Change]], with the slot set to the newly chosen slot.
 
 
 
=== <code>MC|PingHost</code> ===
 
''Client to server''
 
 
 
Sent ''after'' a Server list ping in Minecraft 1.6. More information on [[Server List Ping#1.6]]. In 1.7 and above, the [[Protocol#Request|Request]] ([[Protocol#Status|Status]], 0x00, serverbound) packet is instead sent ''before'' the ping.
 
 
 
{{Warning|Since this plugin channel is only sent for the legacy server list ping, it uses the older packet structure.}}}
 
 
 
=== <code>MC|StopSound</code> ===
 
 
 
Used to implement {{Minecraft Wiki|Commands#StopSound|the <code>/stopsound</code> command}}. Stops a sound that is currently playing on the client.
 
 
 
{| class="wikitable"
 
  ! Field name
 
! Field type
 
! Notes
 
 
  |-
 
  |-
  | Sound name
+
  |rowspan="2"| Data
  | String
+
  | Sub position
  | A [http://pokechu22.github.io/Burger/1.11.html#sounds sound effect name]. If left empty, ''all'' sounds are stopped.
+
  |rowspan="2"| Array
 +
  | Position
 +
|
 
  |-
 
  |-
  | Sound category
+
  | Radius
  | String
+
  | Float
  | Should be one of the sound categories used in [[Protocol#Named Sound Effect|Named Sound Effect]], but if it's invalid or empty then it is (intentionally) treated as ''all'' sound categories.
+
  | Size of the area, as half of the side-length
 
  |}
 
  |}
  
Emptiness of sound category or sound name can be combined, IE a empty sound name but a set sound category will stop all sounds in the given category.
+
=== <code>minecraft:debug/structures</code> ===
  
=== <code>MC|Struct</code> ===
+
Never sent, but (presumably) used to debug structures.  Does not render without modifying the client.
  
''Client to server''
+
Adds a single new structure, which will always be rendered if the player is in the same dimension.
 
 
Sets information about the {{Minecraft Wiki|Structure block}}.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! Field Name
+
  !colspan="2"| Field name
  ! Field Type
+
  !colspan="2"| Field type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  | X || Int || Tile entity location
+
  |colspan="2"| Dimension
 +
|colspan="2"| Int
 +
| The dimension the structure is in.
 
  |-
 
  |-
  | Y || Int || Tile entity location
+
  |colspan="2"| Bounding box minX
 +
|colspan="2"| Int
 +
|rowspan="6"| Main box for the structure (rendered in white).  min must be less than max
 
  |-
 
  |-
  | Z || Int || Tile entity location
+
  |colspan="2"| Bounding box minY
 +
|colspan="2"| Int
 
  |-
 
  |-
  | Action
+
  |colspan="2"| Bounding box minZ
  | Byte
+
  |colspan="2"| Int
| See below
 
 
  |-
 
  |-
  | Mode
+
  |colspan="2"| Bounding box maxX
| String enum
+
  |colspan="2"| Int
  | One of "SAVE", "LOAD", "CORNER", "DATA".
 
 
  |-
 
  |-
  | Name
+
  |colspan="2"| Bounding box maxY
  | String
+
  |colspan="2"| Int
|
 
 
  |-
 
  |-
  | Offset X || Int
+
  |colspan="2"| Bounding box maxZ
  | Between -32 and 32
+
  |colspan="2"| Int
 
  |-
 
  |-
  | Offset Y || Int
+
  |colspan="2"| Count
  | Between -32 and 32
+
|colspan="2"| Int
 +
  | Number of elements in the following array
 
  |-
 
  |-
  | Offset Z || Int
+
  |rowspan="7"| Sub-boxes
  | Between -32 and 32
+
| Bounding box minX
 +
|rowspan="7"| Array
 +
| Int
 +
  |rowspan="6"| min must be less than max
 
  |-
 
  |-
  | Size X || Int
+
  | Bounding box minY
  | Between 0 and 32
+
  | Int
 
  |-
 
  |-
  | Size Y || Int
+
  | Bounding box minZ
  | Between 0 and 32
+
  | Int
 
  |-
 
  |-
  | Size Z || Int
+
  | Bounding box maxX
  | Between 0 and 32
+
  | Int
 
  |-
 
  |-
  | Mirror
+
  | Bounding box maxY
  | String enum
+
  | Int
| One of "NONE", "LEFT_RIGHT", "FRONT_BACK".
 
 
  |-
 
  |-
  | Rotation
+
  | Bounding box maxZ
| String enum
+
  | Int
| One of "NONE", "CLOCKWISE_90", "CLOCKWISE_180", "COUNTERCLOCKWISE_90".
 
|-
 
| Metadata
 
| String
 
|
 
|-
 
| Ignore entities
 
| Boolean
 
  |
 
 
  |-
 
  |-
  | Show air
+
  | Flag
 
  | Boolean
 
  | Boolean
  |
+
  | If true, the sub-box is rendered in green, otherwise in blue.
|-
 
| Show bounding box
 
| Boolean
 
|
 
|-
 
| Integrity
 
| Float
 
| Between 0 and 1
 
|-
 
|Seed
 
|VarLong
 
|
 
 
  |}
 
  |}
  
Possible modes:
+
=== <code>minecraft:debug/worldgen_attempt</code> ===
  
* 2 - Save the structure
+
Never sent, but (presumably) used to debug something with world generation.  Does not render without modifying the client.
* 3 - Load the structure
 
* 4 - Detect size
 
  
=== <code>MC|TrList</code> ===
+
Adds a colored cube of the list of things to render.  This cube is never removed.
''Server to client''
 
 
 
The list of trades a villager NPC is offering.
 
  
 
{| class="wikitable"
 
{| class="wikitable"
  ! colspan="2" | Field Name
+
  ! Field name
  ! colspan="2" | Field Type
+
  ! Field type
 
  ! Notes
 
  ! Notes
 
  |-
 
  |-
  | colspan="2" | Window ID
+
  | Location
  | colspan="2" | Int
+
  | Position
  | The ID of the window that is open; this is an int rather than a byte.
+
  | The center of the location to render.
 
  |-
 
  |-
  | colspan="2" | Size
+
  | Size
  | colspan="2" | Byte
+
  | Float
  | The number of trades in the following array
+
  | Diameter/side length of a cube to render.
 
  |-
 
  |-
  | rowspan="7" | Trades
+
  | Red
  | Input item 1
+
  | Float
  | rowspan="7" | Array
+
  | Red value to render, from 0.0 to 1.0.
| Slot
 
| The first item the villager is buying
 
 
  |-
 
  |-
  | Output item
+
  | Green
  | Slot
+
  | Float
  | The item the villager is selling
+
  | Green value to render, from 0.0 to 1.0.
 
  |-
 
  |-
  | Has second item
+
  | Blue
  | Boolean
+
  | Float
  | Whether there is a second item
+
  | Blue value to render, from 0.0 to 1.0.
 
  |-
 
  |-
  | Input item 2
+
  | Alpha
  | Optional slot
+
  | Float
  | The second item the villager is buying; only present if they have a second item.
+
  | Alpha value to render, from 0.0 to 1.0.
|-
 
| Trade disabled
 
| Boolean
 
| True if the trade is disabled; false if the trade is enabled.
 
|-
 
| Number of tool uses
 
| Int
 
| May actually be the number of times this trade has been used; MCP may be misleading me
 
|-
 
| Maximum number of trade uses
 
| Int
 
| Number of times this trade can be used
 
 
  |}
 
  |}
  
=== <code>MC|TrSel</code> ===
+
=== <code>minecraft:debug/poi_ticket_count</code> ===
 +
=== <code>minecraft:debug/poi_added</code> ===
 +
=== <code>minecraft:debug/poi_removed</code> ===
 +
=== <code>minecraft:debug/village_sections</code> ===
 +
=== <code>minecraft:debug/goal_selector</code> ===
 +
=== <code>minecraft:debug/brain</code> ===
 +
 
 +
 
 +
=== <code>MC|PingHost</code> ===
 
''Client to server''
 
''Client to server''
  
When a player selects a specific trade offered by a villager NPC.
+
Sent ''after'' a Server list ping in Minecraft 1.6. More information on [[Server List Ping#1.6]]. In 1.7 and above, the [[Protocol#Request|Request]] ([[Protocol#Status|Status]], 0x00, serverbound) packet is instead sent ''before'' the ping.
It contains a single int id corresponding to the selected slot int the players current (trading) inventory.
+
 
 +
{{Warning|Since this plugin channel is only sent for the legacy server list ping, it uses the older packet structure.}}
  
 
== Notable community plugin channels ==
 
== Notable community plugin channels ==
 
Channels listed in this section are not used by the vanilla Minecraft client or server. This is just a likely-incomplete list of channels used by mods/plugins popular within the Minecraft community.
 
Channels listed in this section are not used by the vanilla Minecraft client or server. This is just a likely-incomplete list of channels used by mods/plugins popular within the Minecraft community.
  
=== <code>BungeeCord</code> ===
+
=== <code>bungeecord:main</code> ===
 +
 
 +
Formerly <code>BungeeCord</code>; additionally, note that the channel name is remapped by spigot so that the old name can still be used in plugins.
  
 
[http://www.spigotmc.org/wiki/bukkit-bungee-plugin-messaging-channel/ See here]
 
[http://www.spigotmc.org/wiki/bukkit-bungee-plugin-messaging-channel/ See here]
Line 515: Line 404:
 
Used by the server-side [http://www.enginehub.org/worldedit/ WorldEdit] and the client-side [http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1292886-worldeditcui/ WorldEditCUI] to coordinate selections.
 
Used by the server-side [http://www.enginehub.org/worldedit/ WorldEdit] and the client-side [http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1292886-worldeditcui/ WorldEditCUI] to coordinate selections.
  
=== <code>WDL|INIT</code>, <code>WDL|CONTROL</code>, <code>WDL|REQUEST</code> ===
+
=== <code>wdl:init</code>, <code>wdl:control</code>, <code>wdl:request</code> ===
  
 
{{Main|/World downloader}}
 
{{Main|/World downloader}}
  
 
Used by the client-side [http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/2520465 World Downloader mod] to get permission information and perform permission requests.
 
Used by the client-side [http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/2520465 World Downloader mod] to get permission information and perform permission requests.
 +
 +
[[Category:Minecraft Modern]]

Revision as of 13:55, 7 April 2019

Plugin channels allow client mods and server plugins to communicate without cluttering up chat. This post by Dinnerbone is a good introduction and basic documentation.

Reserved channels

minecraft:register

Two-way

Allows the client or server to register for one or more custom channels, indicating that data should be sent on those channels if the receiving end supports it too. Payload is a null (0x00) separated list of strings.

This channel was renamed from REGISTER in 1.13.

minecraft:unregister

Two-way

Allows the client or server to unregister from one or more custom channels, indicating that the receiving end should stop sending data on those channels. Payload is a null-separated list of strings. This is only useful if plugins are disabled/unloaded while the client is connected.

This channel was renamed from UNREGISTER in 1.13.

Channels internal to Minecraft

Since 1.3, Minecraft itself uses several plugin channels to implement new features. These internal channels use the minecraft namespace. They are not formally registered using the register channel. The vanilla Minecraft server will send these packets regardless, and the vanilla client will accept them.

Note that there were originally more channels included, but most of these were removed in 1.13. See this revision of the article for the original list.

minecraft:brand

Two-way

Announces the server and client implementation name right after a player has logged in. For the Notchian client and server server, this is "vanilla" (which is chosen using the Function net.minecraft.client.ClientBrandRetriever.getClientModName()) (encoded as a protocol string: a UTF-8 string with the length prefixed as a VarInt).

These brands are used in crash reports and a few other locations; it's recommended that custom clients and servers use changed brands for the purpose of identification (for the Notchian client, the class used to get the brand is one of the few non-obfuscated classes). The brand is not processed in any other way, and Notchian clients will connect to servers with changed brands with no issue (the brand is not used to validate).

The Notchian server sends a minecraft:brand packet right after it sends a Join Game packet, and the Notchian client sends it right after receiving a Join Game packet. However, some modified clients and servers will not send this packet (or will take longer to send it than normal), so it is important to not crash if the brand has not been sent. Additionally, the brand may change at any time (for instance, if connected through a BungeeCord instance, you may switch from a server with one brand to a server with another brand without receiving a Join Game packet).

minecraft:book_open

Server to client

When a player right clicks with a signed book. This tells the client to open the book GUI.

The payload is a VarInt enum for the selected hand: 0 for the main hand, 1 for the offhand.

minecraft:trader_list

Server to client

The list of trades a villager NPC is offering.

Field Name Field Type Notes
Window ID Int The ID of the window that is open; this is an int rather than a byte.
Size Byte The number of trades in the following array
Trades Input item 1 Array Slot The first item the villager is buying
Output item Slot The item the villager is selling
Has second item Boolean Whether there is a second item
Input item 2 Optional slot The second item the villager is buying; only present if they have a second item.
Trade disabled Boolean True if the trade is disabled; false if the trade is enabled.
Number of trade uses Int Number of times the trade has been used so far
Maximum number of trade uses Int Number of times this trade can be used

minecraft:debug/paths

Server to client

What appears to be the purpose of minecraft:debug/paths as seen in the snapshot 16w14a announcement. This is not found in the normal game.

Never sent, but does something with pathfinding debugging. The client reads the data and stores it, but its renderer cannot be enabled without modifications.

Name Type Notes
Unknown 1 Int Used as a key in the mapping that stores this data; might be an entity ID?
Unknown 2 Float Appears to be the "radius" of the squares for each pathpoint
Entity PathEntity See below

PathEntity structure:

Name Type Notes
Current path index Int Index in the points array that the entity is currently targeting. That point is rendered red; the others are rendered blue.
Target PathPoint Rendered as a green cube
Number of points Int Number of elements in the following array
Points array Array of PathPoint The actual points on the path
Open set length Int Number of elements in the following array
Open set Array of PathPoint Displayed in blue
Closed set length Int Number of elements in the following array
Closed set Array of PathPoint Displayed in red

PathPoint structure:

Name Type Notes
X Int
Y Int
Z Int
Distance from origin Float
Cost Float
Cost malus Float Number that is rendered
Has been visited Boolean
Node type Int enum See below
Distance to target Float

Values for node type:

  • 0: BLOCKED
  • 1: OPEN
  • 2: WALKABLE
  • 3: TRAPDOOR
  • 4: FENCE
  • 5: LAVA
  • 6: WATER
  • 7: RAIL
  • 8: DANGER_FIRE
  • 9: DAMAGE_FIRE
  • 10: DANGER_CACTUS
  • 11: DAMAGE_CACTUS
  • 12: DANGER_OTHER
  • 13: DAMAGE_OTHER
  • 14: DOOR_OPEN
  • 15: DOOR_WOOD_CLOSED
  • 16: DOOR_IRON_CLOSED

minecraft:debug/neighbors_update

Server to client

Never sent, but used to debug block updates. Does not render without modifying the client.

Name Type Notes
Time VarLong World timestamp at which the update occurred. 200 ticks after this timestamp, the given update stops rendering.
Location Position Location of the block that updated.

minecraft:debug/caves

Never sent, but (presumably) used to debug caves. Does not render without modifying the client.

Field name Field type Notes
Cave position Position Rendered as a white cube; also used to determine the color of the other parts.
Count Int Number of elements in the following array
Data Sub position Array Position
Radius Float Size of the area, as half of the side-length

minecraft:debug/structures

Never sent, but (presumably) used to debug structures. Does not render without modifying the client.

Adds a single new structure, which will always be rendered if the player is in the same dimension.

Field name Field type Notes
Dimension Int The dimension the structure is in.
Bounding box minX Int Main box for the structure (rendered in white). min must be less than max
Bounding box minY Int
Bounding box minZ Int
Bounding box maxX Int
Bounding box maxY Int
Bounding box maxZ Int
Count Int Number of elements in the following array
Sub-boxes Bounding box minX Array Int min must be less than max
Bounding box minY Int
Bounding box minZ Int
Bounding box maxX Int
Bounding box maxY Int
Bounding box maxZ Int
Flag Boolean If true, the sub-box is rendered in green, otherwise in blue.

minecraft:debug/worldgen_attempt

Never sent, but (presumably) used to debug something with world generation. Does not render without modifying the client.

Adds a colored cube of the list of things to render. This cube is never removed.

Field name Field type Notes
Location Position The center of the location to render.
Size Float Diameter/side length of a cube to render.
Red Float Red value to render, from 0.0 to 1.0.
Green Float Green value to render, from 0.0 to 1.0.
Blue Float Blue value to render, from 0.0 to 1.0.
Alpha Float Alpha value to render, from 0.0 to 1.0.

minecraft:debug/poi_ticket_count

minecraft:debug/poi_added

minecraft:debug/poi_removed

minecraft:debug/village_sections

minecraft:debug/goal_selector

minecraft:debug/brain

MC|PingHost

Client to server

Sent after a Server list ping in Minecraft 1.6. More information on Server List Ping#1.6. In 1.7 and above, the Request (Status, 0x00, serverbound) packet is instead sent before the ping.

Warning.png Since this plugin channel is only sent for the legacy server list ping, it uses the older packet structure.

Notable community plugin channels

Channels listed in this section are not used by the vanilla Minecraft client or server. This is just a likely-incomplete list of channels used by mods/plugins popular within the Minecraft community.

bungeecord:main

Formerly BungeeCord; additionally, note that the channel name is remapped by spigot so that the old name can still be used in plugins.

See here

FML|HS, FML

Main article: Minecraft Forge Handshake

Used by Minecraft Forge to negotiate required mods, among other things. FML|HS FML

ML|OpenTE

Server to client

Used by ModLoader to support custom GUI windows. Does not use the REGISTER channel.

WECUI

Main article: /WorldEditCUI

Used by the server-side WorldEdit and the client-side WorldEditCUI to coordinate selections.

wdl:init, wdl:control, wdl:request

Main article: /World downloader

Used by the client-side World Downloader mod to get permission information and perform permission requests.