Difference between revisions of "Plugin channels"

From wiki.vg
Jump to navigation Jump to search
(Added MC|PingHost)
(4 intermediate revisions by the same user not shown)
Line 14: Line 14:
 
== Channels internal to Minecraft ==
 
== 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.
 
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> ===
 +
''Two-way''
 +
 +
Adventure mode command block. Three integers for the x/y/z block coordinates, followed by a string: the command the block should run.
 +
 +
=== <code>MC|Beacon</code> ===
 +
''Client to server''
 +
 +
Two integers corresponding to the 2 effects a user wishes to have active.
  
 
=== <code>MC|BEdit</code> ===
 
=== <code>MC|BEdit</code> ===
Line 27: Line 37:
 
When a player signs a book.
 
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.
 
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|TPack</code> ===
 
=== <code>MC|TPack</code> ===
Line 39: Line 54:
 
The list of trades a villager NPC is offering.
 
The list of trades a villager NPC is offering.
  
=== <code>MC|Beacon</code> ===
 
''Client to server''
 
 
To integers corresponding to the 2 effects a user wishes to have active
 
 
=== <code>MC|TrSel</code> ===
 
=== <code>MC|TrSel</code> ===
 
''Client to server''
 
''Client to server''
+
 
When a player selects a specific trade offered by a villager NPC.
 
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.
 
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]]
 +
  
 
== Notable community plugin channels ==
 
== 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.
 
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>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> ===
 
=== <code>ML|OpenTE</code> ===
 
''Server to client''
 
''Server to client''
  
Used by [http://www.minecraftforum.net/topic/75440-v132-risugamis-mods-preliminary-updates/ ModLoader] to support custom GUI windows. Does not use the REGISTER channel.
+
Used by [http://www.minecraftforum.net/topic/75440-modloader/ ModLoader] to support custom GUI windows. Does not use the REGISTER channel.
  
 
=== <code>WECUI</code> ===
 
=== <code>WECUI</code> ===

Revision as of 15:48, 12 July 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

Two-way

Adventure mode command block. Three integers for the x/y/z block coordinates, followed by a string: the command the block should run.

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|TPack

Server to client

Remote texture packs. This contains a string representing the url to get the texture pack from, followed by null (\00) and then '16', all in ASCII.

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


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.

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.