Plugin channel: Difference between revisions
imported>Thinkofdeath (→Notable community plugin channels: Add bungeecord) |
imported>Thinkofdeath m (→BungeeCord) |
||
| Line 105: | Line 105: | ||
Strings in this channel are UTF8 strings prefixed with a short for length. | Strings in this channel are UTF8 strings prefixed with a short for length. | ||
The first string is the ''SubChannel'' | The first string is the ''SubChannel'' followed by data depending on the value of ''SubChannel'' | ||
==== Forward ==== | ==== Forward ==== | ||
Revision as of 20:23, 7 November 2013
Plugin channels are implemented using packet 0xFA, allowing client mods and server plugins to communicate without cluttering up chat. This post by Dinnerbone is a good introduction and basic documentation.
Reserved channels
REGISTER
Two-way
Allows the client to register for one or more custom channels, indicating that the server should send data on those channels if the appropriate plugin is installed. Payload is a null (\00) separated list of strings.
UNREGISTER
Two-way
Allows the client to unregister from one or more custom channels, indicating that the server should stop sending data on those channels. Payload is a null-separated list of strings.
Channels internal to Minecraft
As of 1.3, Minecraft itself started using plugin channels to implement new features. These internal channel names are prefixed by MC|. 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.
MC|AdvCdm
Client -> Server
Adventure mode command block.
The first byte is type which is followed by either:
| Type | Field Name | Field Type | Notes |
|---|---|---|---|
| 0x00 | X | Int | |
| Y | Int | ||
| Z | Int | ||
| Command | String |
or
| Type | Field Name | Field Type | Notes |
|---|---|---|---|
| 0x01 | Entity ID | Int | |
| Command | String |
depending on the mode
MC|Beacon
Client to server
Two integers corresponding to the 2 effects a user wishes to have active.
MC|BEdit
Client to server
When a player edits an unsigned book.
This payload is simply a set of bytes corresponding to an ItemStack. It is serialized / deserialized exactly the same as itemstacks in packets.
MC|BSign
Client to server
When a player signs a book. This payload is simply a set of bytes corresponding to an ItemStack. It is serialized / deserialized exactly the same as itemstacks in packets.
MC|ItemName
Two-way
When a player uses an anvil to name an item. The payload is just a string: the item's new name.
MC|RPack
Server to client
Remote resource packs. This contains a string representing the url to get the resource pack from.
MC|TrList
Server to client
The list of trades a villager NPC is offering.
MC|TrSel
Client to server
When a player selects a specific trade offered by a villager NPC. It contains a single int id corresponding to the selected slot int the players current (trading) inventory.
MC|PingHost
Client to server
Sent after a Server list ping. More information on Server List Ping
MC|Brand
Two-way
Announces the server and client implementation name right after a player has logged in. For Minecraft and the standard Minecraft server, this is "vanilla" (encoded as a UTF-8 string).
Notable community plugin channels
Channels listed in this section are not Mojang-sanctioned. This is just a likely-incomplete list of channels used by mods/plugins popular within the Minecraft community.
BungeeCord
Strings in this channel are UTF8 strings prefixed with a short for length.
The first string is the SubChannel followed by data depending on the value of SubChannel
Forward
Server -> Bungee
Forwards the bungeecord plugin message to the target server
| Field Name | Field Type | Notes |
|---|---|---|
| Target | String | Server name, the value ALL sends to all servers |
| Channel | String | Channel name |
| Length | Short | Length of the following payload |
| Payload | Array of bytes |
Connect
Server -> Bungee
| Field Name | Field Type | Notes |
|---|---|---|
| Target | String | Server name |
ConnectOther
Server -> Bungee
| Field Name | Field Type | Notes |
|---|---|---|
| Player Name | String | Target player's name |
| Target | String | Server name |
IP
Server -> Bungee
Request the bungeecord to send back the player's real ip
| Field Name | Field Type | Notes |
|---|
Bungee -> Server
| Field Name | Field Type | Notes |
|---|---|---|
| Host | String | |
| Port | Int |
PlayerCount
Server -> Bungee
Request the bungeecord to send back number of players on the target server
| Field Name | Field Type | Notes |
|---|---|---|
| Target | String | Target server, the value ALL means all servers |
Bungee -> Server
| Field Name | Field Type | Notes |
|---|---|---|
| Name | String | |
| Player count | Int |
PlayerList
Server -> Bungee
Request the bungeecord to send back a csv of players on the target server
| Field Name | Field Type | Notes |
|---|---|---|
| Target | String | Target server, the value ALL means all servers |
Bungee -> Server
| Field Name | Field Type | Notes |
|---|---|---|
| Name | String | |
| Players | String | A comma separated list of player names |
GetServers
Server -> Bungee
Request the bungeecord to send back a csv of all servers
| Field Name | Field Type | Notes |
|---|
Bungee -> Server
| Field Name | Field Type | Notes |
|---|---|---|
| Servers | String | A comma separated list of server names |
Message
Server -> Bungee
| Field Name | Field Type | Notes |
|---|---|---|
| Player | String | |
| Message | String |
GetServer
Server -> Bungee
Request the bungeecord to send the player's current server
| Field Name | Field Type | Notes |
|---|
Bungee -> Server
| Field Name | Field Type | Notes |
|---|---|---|
| Server name | String |
FML
Two-way
Used by Forge ModLoader to negotiate required mods, among other things. [1]
ML|OpenTE
Server to client
Used by ModLoader to support custom GUI windows. Does not use the REGISTER channel.
WECUI
Two-way
Used by the server-side WorldEdit and the client-side WorldEditCUI to coordinate selections.