Difference between revisions of "Plugin channels"
m (Join Game -> Login (play)) |
|||
(13 intermediate revisions by 7 users not shown) | |||
Line 1: | Line 1: | ||
− | '''Plugin channels''' allow client mods and server plugins to communicate without cluttering up chat. [ | + | '''Plugin channels''' allow client mods and server plugins to communicate without cluttering up chat. [https://web.archive.org/web/20220711204310/https://dinnerbone.com/blog/2012/01/13/minecraft-plugin-channels-messaging/ This post by Dinnerbone] is a good introduction and basic documentation. |
{{anchor|Internal}} | {{anchor|Internal}} | ||
== Definitions == | == Definitions == | ||
Line 14: | Line 14: | ||
|- | |- | ||
| Current path index | | Current path index | ||
− | | Int | + | | {{Type|Int}} |
| Index in the points array that the entity is currently targeting. | | Index in the points array that the entity is currently targeting. | ||
|- | |- | ||
Line 22: | Line 22: | ||
|- | |- | ||
| Number of points | | Number of points | ||
− | | Int | + | | {{Type|Int}} |
| Number of elements in the following array | | Number of elements in the following array | ||
|- | |- | ||
| Points array | | Points array | ||
− | | Array of PathPoint | + | | {{Type|Array}} of PathPoint |
| The actual points on the path | | The actual points on the path | ||
|- | |- | ||
| Open set length | | Open set length | ||
− | | Int | + | | {{Type|Int}} |
| Number of elements in the following array | | Number of elements in the following array | ||
|- | |- | ||
| Open set | | Open set | ||
− | | Array of PathPoint | + | | {{Type|Array}} of PathPoint |
| | | | ||
|- | |- | ||
| Closed set length | | Closed set length | ||
− | | Int | + | | {{Type|Int}} |
| Number of elements in the following array | | Number of elements in the following array | ||
|- | |- | ||
| Closed set | | Closed set | ||
− | | Array of PathPoint | + | | {{Type|Array}} of PathPoint |
| | | | ||
|} | |} | ||
Line 59: | Line 59: | ||
|- | |- | ||
| X | | X | ||
− | | Int | + | | {{Type|Int}} |
| | | | ||
|- | |- | ||
| Y | | Y | ||
− | | Int | + | | {{Type|Int}} |
| | | | ||
|- | |- | ||
| Z | | Z | ||
− | | Int | + | | {{Type|Int}} |
| | | | ||
|- | |- | ||
| Distance from origin | | Distance from origin | ||
− | | Float | + | | {{Type|Float}} |
| | | | ||
|- | |- | ||
| Cost | | Cost | ||
− | | Float | + | | {{Type|Float}} |
| | | | ||
|- | |- | ||
| Cost malus | | Cost malus | ||
− | | Float | + | | {{Type|Float}} |
| Number that is rendered | | Number that is rendered | ||
|- | |- | ||
| Has been visited | | Has been visited | ||
− | | Boolean | + | | {{Type|Boolean}} |
| | | | ||
|- | |- | ||
| Node type | | Node type | ||
− | | Int | + | | {{Type|Int}} {{Type|Enum}} |
| See below | | See below | ||
|- | |- | ||
| Distance to target | | Distance to target | ||
− | | Float | + | | {{Type|Float}} |
| | | | ||
|} | |} | ||
Line 145: | Line 145: | ||
''For version 1.12.2(protocol version 340) and below, channel name is: <code>MC|Brand</code>'' | ''For version 1.12.2(protocol version 340) and below, channel name is: <code>MC|Brand</code>'' | ||
− | Announces the server and client implementation name right after a player has logged in. For the Notchian client and server, this is "vanilla" (which is chosen using the | + | Announces the server and client implementation name right after a player has logged in. For the Notchian client and server, this is "vanilla" (which is chosen using the function <code>net.minecraft.client.ClientBrandRetriever.getClientModName()</code> and encoded as a UTF-8 string). |
These brands are used in crash reports and a few other locations. It's recommended that custom clients and servers use their own brand names 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 different brands with no issue (the brand is not used to validate). | These brands are used in crash reports and a few other locations. It's recommended that custom clients and servers use their own brand names 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 different brands with no issue (the brand is not used to validate). | ||
− | The Notchian server sends a <code>minecraft:brand</code> packet right after it sends a [[Protocol# | + | The Notchian server sends a <code>minecraft:brand</code> packet right after it sends a [[Protocol#Login (play)|Login (play)]] packet, and the Notchian client sends it right after receiving a Login (play) 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 Login (play) packet). |
− | === <code>minecraft:debug/ | + | === <code>minecraft:debug/path</code> === |
''Server to client'' | ''Server to client'' | ||
− | [[File:MC-DebugPath_in_16w14a.png|thumb|What appears to be the purpose of <code><nowiki>minecraft:debug/ | + | [[File:MC-DebugPath_in_16w14a.png|thumb|What appears to be the purpose of <code><nowiki>minecraft:debug/path</nowiki></code> as seen in the [https://web.archive.org/web/20161224194609/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 164: | Line 164: | ||
|- | |- | ||
| Unknown 1 | | Unknown 1 | ||
− | | Int | + | | {{Type|Int}} |
| Used as a key in the mapping that stores this data; might be an entity ID? | | Used as a key in the mapping that stores this data; might be an entity ID? | ||
|- | |- | ||
| Unknown 2 | | Unknown 2 | ||
− | | Float | + | | {{Type|Float}} |
| Appears to be the "radius" of the squares for each pathpoint | | Appears to be the "radius" of the squares for each pathpoint | ||
|- | |- | ||
Line 189: | Line 189: | ||
|- | |- | ||
| Time | | Time | ||
− | | VarLong | + | | {{Type|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. | ||
|- | |- | ||
| Location | | Location | ||
− | | Position | + | | {{Type|Position}} |
| Location of the block that updated. | | Location of the block that updated. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|} | |} | ||
Line 241: | Line 211: | ||
|- | |- | ||
|colspan="2"| Dimension | |colspan="2"| Dimension | ||
− | |colspan="2"| Int | + | |colspan="2"| {{Type|Int}} |
| The dimension the structure is in. | | The dimension the structure is in. | ||
|- | |- | ||
|colspan="2"| Bounding box minX | |colspan="2"| Bounding box minX | ||
− | |colspan="2"| Int | + | |colspan="2"| {{Type|Int}} |
|rowspan="6"| Main box for the structure (rendered in white). min must be less than max | |rowspan="6"| Main box for the structure (rendered in white). min must be less than max | ||
|- | |- | ||
|colspan="2"| Bounding box minY | |colspan="2"| Bounding box minY | ||
− | |colspan="2"| Int | + | |colspan="2"| {{Type|Int}} |
|- | |- | ||
|colspan="2"| Bounding box minZ | |colspan="2"| Bounding box minZ | ||
− | |colspan="2"| Int | + | |colspan="2"| {{Type|Int}} |
|- | |- | ||
|colspan="2"| Bounding box maxX | |colspan="2"| Bounding box maxX | ||
− | |colspan="2"| Int | + | |colspan="2"| {{Type|Int}} |
|- | |- | ||
|colspan="2"| Bounding box maxY | |colspan="2"| Bounding box maxY | ||
− | |colspan="2"| Int | + | |colspan="2"| {{Type|Int}} |
|- | |- | ||
|colspan="2"| Bounding box maxZ | |colspan="2"| Bounding box maxZ | ||
− | |colspan="2"| Int | + | |colspan="2"| {{Type|Int}} |
|- | |- | ||
|colspan="2"| Count | |colspan="2"| Count | ||
− | |colspan="2"| Int | + | |colspan="2"| {{Type|Int}} |
| Number of elements in the following array | | Number of elements in the following array | ||
|- | |- | ||
|rowspan="7"| Sub-boxes | |rowspan="7"| Sub-boxes | ||
| Bounding box minX | | Bounding box minX | ||
− | |rowspan="7"| Array | + | |rowspan="7"| {{Type|Array}} |
− | | Int | + | | {{Type|Int}} |
|rowspan="6"| min must be less than max | |rowspan="6"| min must be less than max | ||
|- | |- | ||
| Bounding box minY | | Bounding box minY | ||
− | | Int | + | | {{Type|Int}} |
|- | |- | ||
| Bounding box minZ | | Bounding box minZ | ||
− | | Int | + | | {{Type|Int}} |
|- | |- | ||
| Bounding box maxX | | Bounding box maxX | ||
− | | Int | + | | {{Type|Int}} |
|- | |- | ||
| Bounding box maxY | | Bounding box maxY | ||
− | | Int | + | | {{Type|Int}} |
|- | |- | ||
| Bounding box maxZ | | Bounding box maxZ | ||
− | | Int | + | | {{Type|Int}} |
|- | |- | ||
| Flag | | Flag | ||
− | | Boolean | + | | {{Type|Boolean}} |
| If true, the sub-box is rendered in green, otherwise in blue. | | If true, the sub-box is rendered in green, otherwise in blue. | ||
|} | |} | ||
Line 307: | Line 277: | ||
|- | |- | ||
| Location | | Location | ||
− | | Position | + | | {{Type|Position}} |
| The center of the location to render. | | The center of the location to render. | ||
|- | |- | ||
| Size | | Size | ||
− | | Float | + | | {{Type|Float}} |
| Diameter/side length of a cube to render. | | Diameter/side length of a cube to render. | ||
|- | |- | ||
| Red | | Red | ||
− | | Float | + | | {{Type|Float}} |
| Red value to render, from 0.0 to 1.0. | | Red value to render, from 0.0 to 1.0. | ||
|- | |- | ||
| Green | | Green | ||
− | | Float | + | | {{Type|Float}} |
| Green value to render, from 0.0 to 1.0. | | Green value to render, from 0.0 to 1.0. | ||
|- | |- | ||
| Blue | | Blue | ||
− | | Float | + | | {{Type|Float}} |
| Blue value to render, from 0.0 to 1.0. | | Blue value to render, from 0.0 to 1.0. | ||
|- | |- | ||
| Alpha | | Alpha | ||
− | | Float | + | | {{Type|Float}} |
| Alpha value to render, from 0.0 to 1.0. | | Alpha value to render, from 0.0 to 1.0. | ||
|} | |} | ||
Line 334: | Line 304: | ||
''Server to client'' | ''Server to client'' | ||
− | Never sent, but used to set amount of free tickets for | + | Never sent, but used to set amount of free tickets for [[POI]] |
{| class="wikitable" | {| class="wikitable" | ||
Line 341: | Line 311: | ||
|- | |- | ||
| Location of POI | | Location of POI | ||
− | | Position | + | | {{Type|Position}} |
|- | |- | ||
| Num of tickets | | Num of tickets | ||
− | | VarInt | + | | {{Type|VarInt}} |
|} | |} | ||
Line 350: | Line 320: | ||
''Server to client'' | ''Server to client'' | ||
− | Never sent, but used to add debugging | + | Never sent, but used to add debugging [[POI]]. Does not render without modifying the client. |
{| class="wikitable" | {| class="wikitable" | ||
Line 362: | Line 332: | ||
|- | |- | ||
| POI Type | | POI Type | ||
− | | String(x) | + | | {{Type|String}} (x) |
− | | Type of POI, | + | | Type of POI, see the [[POI]] article |
|- | |- | ||
| Tickets | | Tickets | ||
− | | VarInt | + | | {{Type|VarInt}} |
| Amount of free tickets | | Amount of free tickets | ||
|} | |} | ||
Line 373: | Line 343: | ||
''Server to client'' | ''Server to client'' | ||
− | Never sent, but used to remove debugging | + | Never sent, but used to remove debugging [[POI]]. Does not render without modifying the client. |
{| class="wikitable" | {| class="wikitable" | ||
Line 396: | Line 366: | ||
|- | |- | ||
| Num of VillageSection locations to be added | | Num of VillageSection locations to be added | ||
− | | VarInt | + | | {{Type|VarInt}} |
| Number of VillageSection locations in following fields. | | Number of VillageSection locations in following fields. | ||
|- | |- | ||
| Location of VillageSection | | Location of VillageSection | ||
− | | Array of Position | + | | {{Type|Array}} of {{Type|Position}} |
| Locations of VillageSections | | Locations of VillageSections | ||
|- | |- | ||
| Num of VillageSection locations to be removed | | Num of VillageSection locations to be removed | ||
− | | VarInt | + | | {{Type|VarInt}} |
| Number of VillageSection locations in following fields. | | Number of VillageSection locations in following fields. | ||
|- | |- | ||
| Location of VillageSection | | Location of VillageSection | ||
− | | Array of Position | + | | {{Type|Array}} of {{Type|Position}} |
| Locations of VillageSections | | Locations of VillageSections | ||
|} | |} | ||
=== <code>minecraft:debug/goal_selector</code> === | === <code>minecraft:debug/goal_selector</code> === | ||
− | {{ | + | ''Server to client'' |
+ | |||
+ | Never sent, but (presumably) used to debug goal selectors. Does not render without modifying the client. | ||
+ | |||
+ | Adds multiple lines of text on the given location, spaced by 0.25 units upward on the Y-axis. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | !colspan="2"| Field name | ||
+ | !colspan="2"| Field type | ||
+ | ! Notes | ||
+ | |- | ||
+ | |colspan="2"| Location | ||
+ | |colspan="2"| {{Type|Position}} | ||
+ | | The location of the goal selector. | ||
+ | |- | ||
+ | |colspan="2"| Unknown | ||
+ | |colspan="2"| {{Type|Int}} | ||
+ | | Key for the goal selector mapping, possibly entity ID. | ||
+ | |- | ||
+ | |colspan="2"| Count | ||
+ | |colspan="2"| {{Type|Int}} | ||
+ | | Number of elements in the following array. | ||
+ | |- | ||
+ | |rowspan="3"| Goals | ||
+ | | Priority | ||
+ | |rowspan="3"| {{Type|Array}} | ||
+ | | {{Type|Int}} | ||
+ | | Currently unused | ||
+ | |- | ||
+ | | Is running | ||
+ | | {{Type|Boolean}} | ||
+ | | Defines the color of the text. #00FF00 if true, #CCCCCC otherwise | ||
+ | |- | ||
+ | | Name | ||
+ | | {{Type|String}} (255) | ||
+ | | | ||
+ | |} | ||
+ | |||
=== <code>minecraft:debug/brain</code> === | === <code>minecraft:debug/brain</code> === | ||
''Server to client'' | ''Server to client'' | ||
Line 425: | Line 432: | ||
|- | |- | ||
| X | | X | ||
− | | Double | + | | {{Type|Double}} |
| X coordinate of villager's position | | X coordinate of villager's position | ||
|- | |- | ||
| Y | | Y | ||
− | | Double | + | | {{Type|Double}} |
| Y coordinate of villager's position | | Y coordinate of villager's position | ||
|- | |- | ||
| Z | | Z | ||
− | | Double | + | | {{Type|Double}} |
| Z coordinate of villager's position | | Z coordinate of villager's position | ||
|- | |- | ||
| Unique ID | | Unique ID | ||
− | | UUID | + | | {{Type|UUID}} |
| Villager's Unique ID | | Villager's Unique ID | ||
|- | |- | ||
Line 445: | Line 452: | ||
|- | |- | ||
| Name | | Name | ||
− | | String(x) | + | | {{Type|String}} (x) |
| Villager's name | | Villager's name | ||
|- | |- | ||
| Profession | | Profession | ||
− | | String(x) | + | | {{Type|String}} (x) |
− | | Villager's | + | | Villager's [https://minecraft.wiki/w/Villager#Professions profession] |
|- | |- | ||
| XP | | XP | ||
− | | VarInt | + | | {{Type|VarInt}} |
| Villager's experience points | | Villager's experience points | ||
|- | |- | ||
| Inventory | | Inventory | ||
− | | String(x) | + | | {{Type|String}} (x) |
| Villager's inventory (need more research on that) | | Villager's inventory (need more research on that) | ||
|- | |- | ||
| Has path | | Has path | ||
− | | Boolean | + | | {{Type|Boolean}} |
| Indicates whether the next field is Path | | Indicates whether the next field is Path | ||
|- | |- | ||
Line 469: | Line 476: | ||
|- | |- | ||
| Wants golem | | Wants golem | ||
− | | Boolean | + | | {{Type|Boolean}} |
| Indicates whether the villager in need of Golem. | | Indicates whether the villager in need of Golem. | ||
|} | |} | ||
Line 484: | Line 491: | ||
|- | |- | ||
| X | | X | ||
− | | Double | + | | {{Type|Double}} |
| X coordinate of rendering location | | X coordinate of rendering location | ||
|- | |- | ||
| Y | | Y | ||
− | | Double | + | | {{Type|Double}} |
| Y coordinate of rendering location | | Y coordinate of rendering location | ||
|- | |- | ||
| Z | | Z | ||
− | | Double | + | | {{Type|Double}} |
| Z coordinate of rendering location | | Z coordinate of rendering location | ||
|- | |- | ||
| Unique ID | | Unique ID | ||
− | | UUID | + | | {{Type|UUID}} |
| Bee's unique ID | | Bee's unique ID | ||
|- | |- | ||
| EID | | EID | ||
− | | VarInt | + | | {{Type|VarInt}} |
| EID of the Bee | | EID of the Bee | ||
|- | |- | ||
| Has hive position | | Has hive position | ||
− | | Boolean | + | | {{Type|Boolean}} |
| True if following field value is location of bee hive. | | True if following field value is location of bee hive. | ||
|- | |- | ||
| Location of hive | | Location of hive | ||
− | | Position | + | | {{Type|Position}} |
| Optional position of bee hive. | | Optional position of bee hive. | ||
|- | |- | ||
| Has flower position | | Has flower position | ||
− | | Boolean | + | | {{Type|Boolean}} |
| True if following field value is location of flower. | | True if following field value is location of flower. | ||
|- | |- | ||
| Location of flower | | Location of flower | ||
− | | Position | + | | {{Type|Position}} |
| Optional position of flower. | | Optional position of flower. | ||
|- | |- | ||
| Travel ticks | | Travel ticks | ||
− | | VarInt | + | | {{Type|VarInt}} |
| Purpose unknown. | | Purpose unknown. | ||
|- | |- | ||
| Has path | | Has path | ||
− | | Boolean | + | | {{Type|Boolean}} |
| True if following field value is path. | | True if following field value is path. | ||
|- | |- | ||
Line 532: | Line 539: | ||
|- | |- | ||
| Num of goals | | Num of goals | ||
− | | VarInt | + | | {{Type|VarInt}} |
| Number of goals in following fields. | | Number of goals in following fields. | ||
|- | |- | ||
| Goal | | Goal | ||
− | | Array of String(x) | + | | {{Type|Array}} of {{Type|String}} (x) |
| Probably string name of goal | | Probably string name of goal | ||
|- | |- | ||
| Num of blacklisted hives | | Num of blacklisted hives | ||
− | | VarInt | + | | {{Type|VarInt}} |
| Number of blacklisted hives in following fields. | | Number of blacklisted hives in following fields. | ||
|- | |- | ||
| Blacklisted hive | | Blacklisted hive | ||
− | | Array of Position | + | | {{Type|Array}} of {{Type|Position}} |
| Position of blacklisted hive. | | Position of blacklisted hive. | ||
|} | |} | ||
Line 559: | Line 566: | ||
|- | |- | ||
| Location | | Location | ||
− | | Position | + | | {{Type|Position}} |
| Rendering location. If a player is more than 30 blocks away, rendering is skipped. | | Rendering location. If a player is more than 30 blocks away, rendering is skipped. | ||
|- | |- | ||
| Hive type | | Hive type | ||
− | | String | + | | {{Type|String}} |
| Name of hive type | | Name of hive type | ||
|- | |- | ||
| Occupant count | | Occupant count | ||
− | | VarInt | + | | {{Type|VarInt}} |
| Number of bees inside this hive | | Number of bees inside this hive | ||
|- | |- | ||
| Honey level | | Honey level | ||
− | | VarInt | + | | {{Type|VarInt}} |
| Level of honey inside this hive | | Level of honey inside this hive | ||
|- | |- | ||
| Sedated | | Sedated | ||
− | | Boolean | + | | {{Type|Boolean}} |
| True if bees are sedated, false otherwise | | True if bees are sedated, false otherwise | ||
|- | |- | ||
| Last seen | | Last seen | ||
− | | VarLong | + | | {{Type|VarLong}} |
| Never used in debug renderer? | | Never used in debug renderer? | ||
|} | |} | ||
Line 595: | Line 602: | ||
|- | |- | ||
| Location | | Location | ||
− | | Position | + | | {{Type|Position}} |
| Location of the marker. | | Location of the marker. | ||
|- | |- | ||
| Color | | Color | ||
− | | VarInt | + | | {{Type|VarInt}} |
| Encoded ARGB color (Read below about encoding). | | Encoded ARGB color (Read below about encoding). | ||
|- | |- | ||
| Name | | Name | ||
− | | String(x) | + | | {{Type|String}} (x) |
| Name of marker | | Name of marker | ||
|- | |- | ||
− | | | + | | Lifetime |
− | | VarInt | + | | {{Type|VarInt}} |
| Time in milliseconds, after which the marker will be destroyed | | Time in milliseconds, after which the marker will be destroyed | ||
|} | |} | ||
Line 622: | Line 629: | ||
</code> | </code> | ||
− | Note that color is normalized by client | + | Note that color is normalized by client. |
=== <code>minecraft:debug/game_test_clear</code> === | === <code>minecraft:debug/game_test_clear</code> === | ||
Line 639: | Line 646: | ||
|- | |- | ||
| Num of locations | | Num of locations | ||
− | | VarInt | + | | {{Type|VarInt}} |
| Number of locations provided by following array | | Number of locations provided by following array | ||
|- | |- | ||
| Locations | | Locations | ||
− | | Array of Position | + | | {{Type|Array}} of {{Type|Position}} |
| Locations of raid centers | | Locations of raid centers | ||
|} | |} | ||
+ | === <code>minecraft:debug/game_event</code> === | ||
+ | ''Server to client'' | ||
+ | |||
+ | Never sent, but used to debug game events. Does not render without modifying the client. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! Field name | ||
+ | ! Field type | ||
+ | ! Notes | ||
+ | |- | ||
+ | | Game event identifier | ||
+ | | {{Type|String}} (x) | ||
+ | | | ||
+ | |- | ||
+ | | Game event location | ||
+ | | {{Type|Position}} | ||
+ | | | ||
+ | |} | ||
+ | |||
+ | === <code>minecraft:debug/game_event_listeners</code> === | ||
+ | ''Server to client'' | ||
+ | |||
+ | Never sent, but used to track game event listeners. Does not render without modifying the client. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! Field name | ||
+ | ! Field type | ||
+ | ! Notes | ||
+ | |- | ||
+ | | Position source type | ||
+ | | {{Type|Identifier}} | ||
+ | | | ||
+ | |- | ||
+ | | Listener data | ||
+ | | {{Type|Byte Array}} | ||
+ | | | ||
+ | |- | ||
+ | | Listener range | ||
+ | | {{Type|VarInt}} | ||
+ | | | ||
+ | |} | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! Position source type | ||
+ | ! {{Type|Identifier}} | ||
+ | ! Data | ||
+ | |- | ||
+ | | Block position source | ||
+ | | <code>minecraft:block</code> | ||
+ | | Data contain single block position | ||
+ | |- | ||
+ | | Entity position source | ||
+ | | <code>minecraft:entity</code> | ||
+ | | Data contain single EID | ||
+ | |- | ||
+ | |} | ||
=== <code>MC|PingHost</code> === | === <code>MC|PingHost</code> === | ||
''Client to server'' | ''Client to server'' | ||
Line 688: | Line 751: | ||
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. | ||
+ | === <code>world_info</code>, <code>world_id</code>, <code>worldinfo:world_id</code> === | ||
+ | |||
+ | Used by [https://www.curseforge.com/minecraft/mc-mods/voxelmap VoxelMap] and [https://www.curseforge.com/minecraft/mc-mods/journeymap JourneyMap (1.16.5+)] to query the world ID, which is useful on BungeeCord-style server networks to keep maps unique. | ||
+ | |||
+ | [[Category:Protocol Details]] | ||
[[Category:Minecraft Modern]] | [[Category:Minecraft Modern]] |
Latest revision as of 14:10, 15 September 2024
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.
Contents
- 1 Definitions
- 2 Reserved channels
- 3 Channels internal to Minecraft
- 3.1 minecraft:brand
- 3.2 minecraft:debug/path
- 3.3 minecraft:debug/neighbors_update
- 3.4 minecraft:debug/structures
- 3.5 minecraft:debug/worldgen_attempt
- 3.6 minecraft:debug/poi_ticket_count
- 3.7 minecraft:debug/poi_added
- 3.8 minecraft:debug/poi_removed
- 3.9 minecraft:debug/village_sections
- 3.10 minecraft:debug/goal_selector
- 3.11 minecraft:debug/brain
- 3.12 minecraft:debug/bee
- 3.13 minecraft:debug/hive
- 3.14 minecraft:debug/game_test_add_marker
- 3.15 minecraft:debug/game_test_clear
- 3.16 minecraft:debug/raids
- 3.17 minecraft:debug/game_event
- 3.18 minecraft:debug/game_event_listeners
- 3.19 MC|PingHost
- 4 Notable community plugin channels
Definitions
Data Types
PathEntity
Represents calculated path of entity.
Name | Type | Notes |
---|---|---|
Current path index | Int | Index in the points array that the entity is currently targeting. |
Target | PathPoint | |
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 | |
Closed set length | Int | Number of elements in the following array |
Closed set | Array of PathPoint |
You can read more here[1].
PathPoint
Represents single point in path
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: WATER_BORDER
- 8: RAIL
- 9: DANGER_FIRE
- 10: DAMAGE_FIRE
- 11: DANGER_CACTUS
- 12: DAMAGE_CACTUS
- 13: DANGER_OTHER
- 14: DAMAGE_OTHER
- 15: DOOR_OPEN
- 16: DOOR_WOOD_CLOSED
- 17: DOOR_IRON_CLOSED
- 18: BREACH
- 19: LEAVES
- 20: STICKY_HONEY
- 21: COCOA
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. As of 1.14, the only remaining channels other than the brand one are debugging-related channels, which are not normally sent.
minecraft:brand
Two-way
For version 1.12.2(protocol version 340) and below, channel name is: MC|Brand
Announces the server and client implementation name right after a player has logged in. For the Notchian client and server, this is "vanilla" (which is chosen using the function net.minecraft.client.ClientBrandRetriever.getClientModName()
and encoded as a UTF-8 string).
These brands are used in crash reports and a few other locations. It's recommended that custom clients and servers use their own brand names 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 different brands with no issue (the brand is not used to validate).
The Notchian server sends a minecraft:brand
packet right after it sends a Login (play) packet, and the Notchian client sends it right after receiving a Login (play) 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 Login (play) packet).
minecraft:debug/path
Server to client
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 Data Types above |
PathEntity's index point is rendered red; the others are rendered blue. PathEntity's target PathPoint is rendered as a green cube. PathPoint's closed set is rendered red, and open set is rendered green.
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/structures
Server to client
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
Server to client
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
Server to client
Never sent, but used to set amount of free tickets for POI
Field name | Field type |
---|---|
Location of POI | Position |
Num of tickets | VarInt |
minecraft:debug/poi_added
Server to client
Never sent, but used to add debugging POI. Does not render without modifying the client.
Field name | Field type | Notes |
---|---|---|
Location | Positon | Location of POI |
POI Type | String (x) | Type of POI, see the POI article |
Tickets | VarInt | Amount of free tickets |
minecraft:debug/poi_removed
Server to client
Never sent, but used to remove debugging POI. Does not render without modifying the client.
Field name | Field type | Notes |
---|---|---|
Location | Positon | Location of POI |
minecraft:debug/village_sections
Server to client
Never sent, but used to add/remove debugging VilliageSections. Does not render without modifying the client.
Field name | Field type | Notes |
---|---|---|
Num of VillageSection locations to be added | VarInt | Number of VillageSection locations in following fields. |
Location of VillageSection | Array of Position | Locations of VillageSections |
Num of VillageSection locations to be removed | VarInt | Number of VillageSection locations in following fields. |
Location of VillageSection | Array of Position | Locations of VillageSections |
minecraft:debug/goal_selector
Server to client
Never sent, but (presumably) used to debug goal selectors. Does not render without modifying the client.
Adds multiple lines of text on the given location, spaced by 0.25 units upward on the Y-axis.
Field name | Field type | Notes | ||
---|---|---|---|---|
Location | Position | The location of the goal selector. | ||
Unknown | Int | Key for the goal selector mapping, possibly entity ID. | ||
Count | Int | Number of elements in the following array. | ||
Goals | Priority | Array | Int | Currently unused |
Is running | Boolean | Defines the color of the text. #00FF00 if true, #CCCCCC otherwise | ||
Name | String (255) |
minecraft:debug/brain
Server to client
Never sent. Used to debug villager's brain. Doesn't render without modifying the client.
Field name | Field type | Notes |
---|---|---|
X | Double | X coordinate of villager's position |
Y | Double | Y coordinate of villager's position |
Z | Double | Z coordinate of villager's position |
Unique ID | UUID | Villager's Unique ID |
Entity ID | EID | Villager's Entity ID |
Name | String (x) | Villager's name |
Profession | String (x) | Villager's profession |
XP | VarInt | Villager's experience points |
Inventory | String (x) | Villager's inventory (need more research on that) |
Has path | Boolean | Indicates whether the next field is Path |
Path | PathEntity | Movement path |
Wants golem | Boolean | Indicates whether the villager in need of Golem. |
minecraft:debug/bee
Server to client
Never sent, but (presumably) used to debug bee pathfinding to hives and flowers. Does not render without modifying the client.
Field name | Field type | Notes |
---|---|---|
X | Double | X coordinate of rendering location |
Y | Double | Y coordinate of rendering location |
Z | Double | Z coordinate of rendering location |
Unique ID | UUID | Bee's unique ID |
EID | VarInt | EID of the Bee |
Has hive position | Boolean | True if following field value is location of bee hive. |
Location of hive | Position | Optional position of bee hive. |
Has flower position | Boolean | True if following field value is location of flower. |
Location of flower | Position | Optional position of flower. |
Travel ticks | VarInt | Purpose unknown. |
Has path | Boolean | True if following field value is path. |
Path | PathEntity | Serialized path. |
Num of goals | VarInt | Number of goals in following fields. |
Goal | Array of String (x) | Probably string name of goal |
Num of blacklisted hives | VarInt | Number of blacklisted hives in following fields. |
Blacklisted hive | Array of Position | Position of blacklisted hive. |
minecraft:debug/hive
Server to client
Never sent, but (presumably) used to debug hives. Does not render without modifying the client.
Field name | Field type | Notes |
---|---|---|
Location | Position | Rendering location. If a player is more than 30 blocks away, rendering is skipped. |
Hive type | String | Name of hive type |
Occupant count | VarInt | Number of bees inside this hive |
Honey level | VarInt | Level of honey inside this hive |
Sedated | Boolean | True if bees are sedated, false otherwise |
Last seen | VarLong | Never used in debug renderer? |
minecraft:debug/game_test_add_marker
Server to client
Never sent, but used to set different debug markers in the world. Does not render for vanilla clients below version 1.16.5.
Field name | Field type | Notes |
---|---|---|
Location | Position | Location of the marker. |
Color | VarInt | Encoded ARGB color (Read below about encoding). |
Name | String (x) | Name of marker |
Lifetime | VarInt | Time in milliseconds, after which the marker will be destroyed |
Color can be encoded as following:
int encoded = 0;
encoded = encoded | ((int) blueChannel);
encoded = encoded | ((int) greenChannel << 8);
encoded = encoded | ((int) redChannel << 16);
encoded = encoded | ((int) alphaChannel << 24);
return encoded;
Note that color is normalized by client.
minecraft:debug/game_test_clear
Clears all debug markers.
minecraft:debug/raids
Server to client
Never sent, but used to set debug raid centers. Does not render without modifying the client.
Field name | Field type | Notes |
---|---|---|
Num of locations | VarInt | Number of locations provided by following array |
Locations | Array of Position | Locations of raid centers |
minecraft:debug/game_event
Server to client
Never sent, but used to debug game events. Does not render without modifying the client.
Field name | Field type | Notes |
---|---|---|
Game event identifier | String (x) | |
Game event location | Position |
minecraft:debug/game_event_listeners
Server to client
Never sent, but used to track game event listeners. Does not render without modifying the client.
Field name | Field type | Notes |
---|---|---|
Position source type | Identifier | |
Listener data | Byte Array | |
Listener range | VarInt |
Position source type | Identifier | Data |
---|---|---|
Block position source | minecraft:block
|
Data contain single block position |
Entity position source | minecraft:entity
|
Data contain single EID |
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.
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.
fml:handshake
, fml:play
- Main article: Minecraft Forge Handshake
Previously FML|HS
, FML
Used by Minecraft Forge to negotiate required mods, among other things.
fml:handshake
and fml:play
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.
world_info
, world_id
, worldinfo:world_id
Used by VoxelMap and JourneyMap (1.16.5+) to query the world ID, which is useful on BungeeCord-style server networks to keep maps unique.