Difference between revisions of "Plugin channels"

From wiki.vg
Jump to navigation Jump to search
(Add ServerToClient note, and previous name for brand)
(fix newline for servertoclient note)
Line 199: Line 199:
 
=== <code>minecraft:debug/caves</code> ===
 
=== <code>minecraft:debug/caves</code> ===
 
''Server to client''
 
''Server to client''
 +
 
Never sent, but (presumably) used to debug caves.  Does not render without modifying the client.
 
Never sent, but (presumably) used to debug caves.  Does not render without modifying the client.
  
Line 228: Line 229:
 
=== <code>minecraft:debug/structures</code> ===
 
=== <code>minecraft:debug/structures</code> ===
 
''Server to client''
 
''Server to client''
 +
 
Never sent, but (presumably) used to debug structures.  Does not render without modifying the client.
 
Never sent, but (presumably) used to debug structures.  Does not render without modifying the client.
  
Line 294: Line 296:
 
=== <code>minecraft:debug/worldgen_attempt</code> ===
 
=== <code>minecraft:debug/worldgen_attempt</code> ===
 
''Server to client''
 
''Server to client''
 +
 
Never sent, but (presumably) used to debug something with world generation.  Does not render without modifying the client.
 
Never sent, but (presumably) used to debug something with world generation.  Does not render without modifying the client.
  
Line 330: Line 333:
 
=== <code>minecraft:debug/poi_ticket_count</code> ===
 
=== <code>minecraft:debug/poi_ticket_count</code> ===
 
''Server to client''
 
''Server to client''
 +
 
Never sent, but used to set amount of free tickets for POI[https://wiki.vg/POI]
 
Never sent, but used to set amount of free tickets for POI[https://wiki.vg/POI]
  
Line 383: Line 387:
 
=== <code>minecraft:debug/village_sections</code> ===
 
=== <code>minecraft:debug/village_sections</code> ===
 
''Server to client''
 
''Server to client''
 +
 
Never sent, but used to add/remove debugging VilliageSections.  Does not render without modifying the client.
 
Never sent, but used to add/remove debugging VilliageSections.  Does not render without modifying the client.
  
Line 411: Line 416:
 
=== <code>minecraft:debug/brain</code> ===
 
=== <code>minecraft:debug/brain</code> ===
 
''Server to client''
 
''Server to client''
 +
 
Never sent. Used to debug villager's brain. Doesn't render without modifying the client.
 
Never sent. Used to debug villager's brain. Doesn't render without modifying the client.
  
Line 469: Line 475:
 
=== <code>minecraft:debug/bee</code> ===
 
=== <code>minecraft:debug/bee</code> ===
 
''Server to client''
 
''Server to client''
 +
 
Never sent, but (presumably) used to debug bee pathfinding to hives and flowers. Does not render without modifying the client.
 
Never sent, but (presumably) used to debug bee pathfinding to hives and flowers. Does not render without modifying the client.
  
Line 543: Line 550:
 
=== <code>minecraft:debug/hive</code> ===
 
=== <code>minecraft:debug/hive</code> ===
 
''Server to client''
 
''Server to client''
 +
 
Never sent, but (presumably) used to debug hives. Does not render without modifying the client.
 
Never sent, but (presumably) used to debug hives. Does not render without modifying the client.
  
Line 577: Line 585:
 
=== <code>minecraft:debug/game_test_add_marker</code> ===
 
=== <code>minecraft:debug/game_test_add_marker</code> ===
 
''Server to client''
 
''Server to client''
 +
 
Never sent, but used to set different debug markers in the world. Does not render without modifying the client.
 
Never sent, but used to set different debug markers in the world. Does not render without modifying the client.
  
Line 620: Line 629:
 
=== <code>minecraft:debug/raids</code> ===
 
=== <code>minecraft:debug/raids</code> ===
 
''Server to client''
 
''Server to client''
 +
 
Never sent, but used to set debug raid centers. Does not render without modifying the client.
 
Never sent, but used to set debug raid centers. Does not render without modifying the client.
  

Revision as of 12:41, 31 August 2020

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.

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

Previous tag: MC|Brand

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: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 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/caves

Server to client

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

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[2]

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[3]. Does not render without modifying the client.

Field name Field type Notes
Location Positon Location of POI
POI Type String(x) Type of POI, you can read more here[4]
Tickets VarInt Amount of free tickets

minecraft:debug/poi_removed

Server to client

Never sent, but used to remove debugging POI[5]. 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

Huh.png The following information needs to be added to this page:
Unknown channel

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[6]
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 without modifying the client.

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
Destroy after VarInt Time in milliseconds(probably), 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. Normalizing the color yourself will result in different color than expected.

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

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: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.