Plugin channel: Difference between revisions

From wiki.vg
Jump to navigation Jump to search
imported>Thinkofdeath
imported>Pokechu22
(Pokechu22 moved page Plugin channel to Plugin channels over redirect: I really prefer the plural form; it's much easier to use and works better for subpages.)
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
'''Plugin channels''' are implemented using [[Protocol#0xFA|packet 0xFA]], allowing client mods and server plugins to communicate without cluttering up chat. [http://dinnerbone.com/blog/2012/01/13/minecraft-plugin-channels-messaging/ This post by Dinnerbone] is a good introduction and basic documentation.
#REDIRECT [[Plugin channels]]
{{anchor|Internal}}
== Reserved channels ==
=== <code>REGISTER</code> ===
''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.
 
=== <code>UNREGISTER</code> ===
''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 <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.
 
=== <code>MC|AdvCdm</code> ===
''Client -> Server''
 
Adventure mode command block.
 
The first byte is ''type'' which is followed by either:
 
{| class="wikitable"
! Type !! Field Name !! Field Type !! Notes
|-
| rowspan=4 | 0x00
| X || Int ||
|-
| Y || Int ||
|-
| Z || Int ||
|-
| Command || String ||
|}
 
or
 
{| class="wikitable"
! Type !! Field Name !! Field Type !! Notes
|-
| rowspan=2 | 0x01
| Entity ID || Int || 
|-
| Command || String ||
|}
 
depending on the ''mode''
 
=== <code>MC|Beacon</code> ===
''Client to server''
 
Two integers corresponding to the 2 effects a user wishes to have active.
 
=== <code>MC|BEdit</code> ===
''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.
 
=== <code>MC|BSign</code> ===
''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.
 
=== <code>MC|ItemName</code> ===
''Two-way''
 
When a player uses an anvil to name an item. The payload is just a string: the item's new name.
 
=== <code>MC|RPack</code> ===
''Server to client''
 
Remote resource packs.
This contains a string representing the url to get the resource pack from.
 
===  <code>MC|TrList</code> ===
''Server to client''
 
The list of trades a villager NPC is offering.
 
=== <code>MC|TrSel</code> ===
''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.
 
=== <code>MC|PingHost</code> ===
''Client to server''
 
Sent after a Server list ping. More information on [[Server List Ping]]
 
=== <code>MC|Brand</code> ===
''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.
 
=== <code>BungeeCord</code> ===
 
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
 
{| class="wikitable"
! 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 =====
{| class="wikitable"
! Field Name !! Field Type !! Notes
|-
| Target || String || Server name
|}
 
==== ConnectOther ====
 
===== Server -> Bungee =====
{| class="wikitable"
! 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
{| class="wikitable"
! Field Name !! Field Type !! Notes
|}
 
===== Bungee -> Server =====
{| class="wikitable"
! 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
{| class="wikitable"
! Field Name !! Field Type !! Notes
|-
| Target || String || Target server, the value ''ALL'' means all servers
|}
 
===== Bungee -> Server =====
{| class="wikitable"
! 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
{| class="wikitable"
! Field Name !! Field Type !! Notes
|-
| Target || String || Target server, the value ''ALL'' means all servers
|}
 
===== Bungee -> Server =====
{| class="wikitable"
! 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
{| class="wikitable"
! Field Name !! Field Type !! Notes
|}
 
===== Bungee -> Server =====
{| class="wikitable"
! Field Name !! Field Type !! Notes
|-
| Servers || String || A comma separated list of server names
|}
 
==== Message ====
 
===== Server -> Bungee =====
 
{| class="wikitable"
! Field Name !! Field Type !! Notes
|-
| Player || String ||
|-
| Message || String ||
|}
 
==== GetServer ====
 
===== Server -> Bungee =====
Request the bungeecord to send the player's current server
{| class="wikitable"
! Field Name !! Field Type !! Notes
|}
 
===== Bungee -> Server =====
{| class="wikitable"
! Field Name !! Field Type !! Notes
|-
| Server name || String ||
|}
 
=== <code>FML</code> ===
''Two-way''
 
Used by [http://www.minecraftforge.net/forum/index.php Forge] ModLoader to negotiate required mods, among other things. [https://github.com/cpw/FML/blob/master/common/cpw/mods/fml/common/network/FMLNetworkHandler.java]
 
=== <code>ML|OpenTE</code> ===
''Server to client''
 
Used by [http://www.minecraftforum.net/topic/75440-modloader/ ModLoader] to support custom GUI windows. Does not use the REGISTER channel.
 
=== <code>WECUI</code> ===
''Two-way''
 
Used by the server-side [http://dev.bukkit.org/server-mods/worldedit/ WorldEdit] and the client-side [http://www.minecraftforum.net/topic/885099-131-worldeditcui-gui-visualizer-for-worldedit-v131/ WorldEditCUI] to coordinate selections.

Latest revision as of 20:56, 9 April 2016

Redirect to: