Difference between revisions of "Protocol"
Jump to navigation
Jump to search
(→Chunk Data: Document my findings/headaches) |
|||
(49 intermediate revisions by 14 users not shown) | |||
Line 5: | Line 5: | ||
|ICON = | |ICON = | ||
|HEADING = Heads up! | |HEADING = Heads up! | ||
− | |CONTENT = This article is about the protocol for the latest '''stable''' release of Minecraft '''computer edition''' ([[Protocol version numbers|1. | + | |CONTENT = This article is about the protocol for the latest '''stable''' release of Minecraft '''computer edition''' ([[Protocol version numbers|1.14.4, protocol 498]]). For the computer edition pre-releases, see [[Pre-release protocol]]. For Pocket Edition, see [[Pocket Edition Protocol Documentation]]. |
}} | }} | ||
This page presents a dissection of the current '''[https://minecraft.net/ Minecraft] protocol'''. | This page presents a dissection of the current '''[https://minecraft.net/ Minecraft] protocol'''. | ||
− | If you're having trouble, check out the [[Protocol FAQ|FAQ]] or ask for help in the IRC channel [ | + | If you're having trouble, check out the [[Protocol FAQ|FAQ]] or ask for help in the IRC channel [ircs://chat.freenode.net:6697/mcdevs #mcdevs on chat.freenode.net] ([http://wiki.vg/MCDevs More Information]). |
'''Note:''' While you may use the contents of this page without restriction to create servers, clients, bots, etc… you still need to provide attribution to #mcdevs if you copy any of the contents of this page for publication elsewhere. | '''Note:''' While you may use the contents of this page without restriction to create servers, clients, bots, etc… you still need to provide attribution to #mcdevs if you copy any of the contents of this page for publication elsewhere. | ||
Line 47: | Line 47: | ||
|- | |- | ||
| Global palette | | Global palette | ||
− | | A table/dictionary/palette mapping nonnegative integers to block states. | + | | A table/dictionary/palette mapping nonnegative integers to block states. Block state IDs are created in a linear fashion based off of order of assignment. One block state ID allocated for each unique block state for a block; if a block has multiple properties then the number of allocated states is the product of the number of values for each property. A current list of properties and state ID ranges is found on [https://pokechu22.github.io/Burger/1.14.4.html burger]. |
+ | |||
+ | Alternatively, the vanilla server now includes an option to export the current block state ID mapping, by running <code>java -cp minecraft_server.jar net.minecraft.data.Main --reports</code>. See [[Data Generators]] for more information. | ||
|- | |- | ||
| Notchian | | Notchian | ||
Line 109: | Line 111: | ||
If Data Length is set to zero, then the packet is uncompressed; otherwise it is the size of the uncompressed packet. | If Data Length is set to zero, then the packet is uncompressed; otherwise it is the size of the uncompressed packet. | ||
− | If compressed, the uncompressed length of (Packet ID + Data) must be equal to or over the threshold set in the packet [[#Set Compression | + | If compressed, the uncompressed length of (Packet ID + Data) must be equal to or over the threshold set in the packet [[#Set Compression|Set Compression]], otherwise the receiving party will disconnect. |
Compression can be disabled by sending the packet [[#Set Compression|Set Compression]] with a negative Threshold, or not sending the Set Compression packet at all. | Compression can be disabled by sending the packet [[#Set Compression|Set Compression]] with a negative Threshold, or not sending the Set Compression packet at all. | ||
Line 138: | Line 140: | ||
| Protocol Version | | Protocol Version | ||
| VarInt | | VarInt | ||
− | | See [[protocol version numbers]] (currently | + | | See [[protocol version numbers]] (currently 498 in Minecraft 1.14.4) |
|- | |- | ||
| Server Address | | Server Address | ||
| String (255) | | String (255) | ||
− | | Hostname or IP, e.g. localhost or 127.0.0.1, that was used to connect. | + | | Hostname or IP, e.g. localhost or 127.0.0.1, that was used to connect. The Notchian server does not use this information. Note that SRV records are a complete redirect, e.g. if _minecraft._tcp.example.com points to mc.example.org, users connecting to example.com will provide mc.example.org as server address in addition to connecting to it. |
|- | |- | ||
| Server Port | | Server Port | ||
Line 205: | Line 207: | ||
|- | |- | ||
| Type | | Type | ||
− | | | + | | VarInt |
− | | The type of object ( | + | | The type of object (same as in [[#Spawn Mob|Spawn Mob]]) |
|- | |- | ||
| X | | X | ||
Line 406: | Line 408: | ||
| | | | ||
|- | |- | ||
− | | | + | | Motive |
− | | | + | | VarInt |
− | | | + | | Panting's ID, see below |
|- | |- | ||
| Location | | Location | ||
Line 425: | Line 427: | ||
{| class="wikitable" | {| class="wikitable" | ||
! Name | ! Name | ||
+ | ! ID | ||
! x | ! x | ||
! y | ! y | ||
Line 430: | Line 433: | ||
! height | ! height | ||
|- | |- | ||
− | | <code> | + | | <code>minecraft:kebab</code> |
+ | | 0 | ||
| 0 | | 0 | ||
| 0 | | 0 | ||
Line 436: | Line 440: | ||
| 16 | | 16 | ||
|- | |- | ||
− | | <code> | + | | <code>minecraft:aztec</code> |
+ | | 1 | ||
| 16 | | 16 | ||
| 0 | | 0 | ||
Line 442: | Line 447: | ||
| 16 | | 16 | ||
|- | |- | ||
− | | <code> | + | | <code>minecraft:alban</code> |
+ | | 2 | ||
| 32 | | 32 | ||
| 0 | | 0 | ||
Line 448: | Line 454: | ||
| 16 | | 16 | ||
|- | |- | ||
− | | <code> | + | | <code>minecraft:aztec2</code> |
+ | | 3 | ||
| 48 | | 48 | ||
| 0 | | 0 | ||
Line 454: | Line 461: | ||
| 16 | | 16 | ||
|- | |- | ||
− | | <code> | + | | <code>minecraft:bomb</code> |
+ | | 4 | ||
| 64 | | 64 | ||
| 0 | | 0 | ||
Line 460: | Line 468: | ||
| 16 | | 16 | ||
|- | |- | ||
− | | <code> | + | | <code>minecraft:plant</code> |
+ | | 5 | ||
| 80 | | 80 | ||
| 0 | | 0 | ||
Line 466: | Line 475: | ||
| 16 | | 16 | ||
|- | |- | ||
− | | <code> | + | | <code>minecraft:wasteland</code> |
+ | | 6 | ||
| 96 | | 96 | ||
| 0 | | 0 | ||
Line 472: | Line 482: | ||
| 16 | | 16 | ||
|- | |- | ||
− | | <code> | + | | <code>minecraft:pool</code> |
+ | | 7 | ||
| 0 | | 0 | ||
| 32 | | 32 | ||
Line 478: | Line 489: | ||
| 16 | | 16 | ||
|- | |- | ||
− | | <code> | + | | <code>minecraft:courbet</code> |
+ | | 8 | ||
| 32 | | 32 | ||
| 32 | | 32 | ||
Line 484: | Line 496: | ||
| 16 | | 16 | ||
|- | |- | ||
− | | <code> | + | | <code>minecraft:sea</code> |
+ | | 9 | ||
| 64 | | 64 | ||
| 32 | | 32 | ||
Line 490: | Line 503: | ||
| 16 | | 16 | ||
|- | |- | ||
− | | <code> | + | | <code>minecraft:sunset</code> |
+ | | 10 | ||
| 96 | | 96 | ||
| 32 | | 32 | ||
Line 496: | Line 510: | ||
| 16 | | 16 | ||
|- | |- | ||
− | | <code> | + | | <code>minecraft:creebet</code> |
+ | | 11 | ||
| 128 | | 128 | ||
| 32 | | 32 | ||
Line 502: | Line 517: | ||
| 16 | | 16 | ||
|- | |- | ||
− | | <code> | + | | <code>minecraft:wanderer</code> |
+ | | 12 | ||
| 0 | | 0 | ||
| 64 | | 64 | ||
Line 508: | Line 524: | ||
| 32 | | 32 | ||
|- | |- | ||
− | | <code> | + | | <code>minecraft:graham</code> |
+ | | 13 | ||
| 16 | | 16 | ||
| 64 | | 64 | ||
Line 514: | Line 531: | ||
| 32 | | 32 | ||
|- | |- | ||
− | | <code> | + | | <code>minecraft:match</code> |
+ | | 14 | ||
| 0 | | 0 | ||
| 128 | | 128 | ||
Line 520: | Line 538: | ||
| 32 | | 32 | ||
|- | |- | ||
− | | <code> | + | | <code>minecraft:bust</code> |
+ | | 15 | ||
| 32 | | 32 | ||
| 128 | | 128 | ||
Line 526: | Line 545: | ||
| 32 | | 32 | ||
|- | |- | ||
− | | <code> | + | | <code>minecraft:stage</code> |
+ | | 16 | ||
| 64 | | 64 | ||
| 128 | | 128 | ||
Line 532: | Line 552: | ||
| 32 | | 32 | ||
|- | |- | ||
− | | <code> | + | | <code>minecraft:void</code> |
+ | | 17 | ||
| 96 | | 96 | ||
| 128 | | 128 | ||
Line 538: | Line 559: | ||
| 32 | | 32 | ||
|- | |- | ||
− | | <code> | + | | <code>skull_and_roses</code> |
+ | | 18 | ||
| 128 | | 128 | ||
| 128 | | 128 | ||
Line 544: | Line 566: | ||
| 32 | | 32 | ||
|- | |- | ||
− | | <code> | + | | <code>minecraft:wither</code> |
+ | | 19 | ||
| 160 | | 160 | ||
| 128 | | 128 | ||
Line 550: | Line 573: | ||
| 32 | | 32 | ||
|- | |- | ||
− | | <code> | + | | <code>minecraft:fighters</code> |
+ | | 20 | ||
| 0 | | 0 | ||
| 96 | | 96 | ||
Line 556: | Line 580: | ||
| 32 | | 32 | ||
|- | |- | ||
− | | <code> | + | | <code>minecraft:pointer</code> |
+ | | 21 | ||
| 0 | | 0 | ||
| 192 | | 192 | ||
Line 562: | Line 587: | ||
| 64 | | 64 | ||
|- | |- | ||
− | | <code> | + | | <code>minecraft:pigscene</code> |
+ | | 22 | ||
| 64 | | 64 | ||
| 192 | | 192 | ||
Line 568: | Line 594: | ||
| 64 | | 64 | ||
|- | |- | ||
− | | <code> | + | | <code>minecraft:burning_skull</code> |
+ | | 23 | ||
| 128 | | 128 | ||
| 192 | | 192 | ||
Line 574: | Line 601: | ||
| 64 | | 64 | ||
|- | |- | ||
− | | <code> | + | | <code>minecraft:skeleton</code> |
+ | | 24 | ||
| 192 | | 192 | ||
| 64 | | 64 | ||
Line 580: | Line 608: | ||
| 48 | | 48 | ||
|- | |- | ||
− | | <code> | + | | <code>minecraft:donkey_kong</code> |
+ | | 25 | ||
| 192 | | 192 | ||
| 112 | | 112 | ||
Line 593: | Line 622: | ||
This packet is sent by the server when a player comes into visible range, ''not'' when a player joins. | This packet is sent by the server when a player comes into visible range, ''not'' when a player joins. | ||
− | This packet must be sent after the [[#Player | + | This packet must be sent after the [[#Player Info|Player Info]] packet that adds the player data for the client to use when spawning a player. If the Player Info for the player spawned by this packet is not present when this packet arrives, Notchian clients will not spawn the player entity. The Player Info packet includes skin/cape data. |
Servers can, however, safely spawn player entities for players not in visible range. The client appears to handle it correctly. | Servers can, however, safely spawn player entities for players not in visible range. The client appears to handle it correctly. | ||
Line 712: | Line 741: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan=" | + | |rowspan="4"| 0x07 |
− | |rowspan=" | + | |rowspan="4"| Play |
− | |rowspan=" | + | |rowspan="4"| Client |
|colspan="2"| Count | |colspan="2"| Count | ||
|colspan="2"| VarInt | |colspan="2"| VarInt | ||
Line 720: | Line 749: | ||
|- | |- | ||
|rowspan="2"| Statistic | |rowspan="2"| Statistic | ||
− | | | + | | Category ID |
|rowspan="2"| Array | |rowspan="2"| Array | ||
− | | | + | | VarInt |
− | | | + | | See below |
|- | |- | ||
− | | | + | | Statistic ID |
| VarInt | | VarInt | ||
+ | | See below | ||
+ | |- | ||
+ | |colspan="2"| Value | ||
+ | |colspan="2"| VarInt | ||
| The amount to set it to | | The amount to set it to | ||
|} | |} | ||
− | + | Categories (these are namespaced, but with <code>:</code> replaced with <code>.</code>): | |
− | + | {| class="wikitable" | |
− | + | ! Name | |
− | + | ! ID | |
− | + | ! Registry | |
− | + | |- | |
− | + | | <code>minecraft.mined</code> | |
− | + | | 0 | |
− | + | | Blocks | |
− | + | |- | |
− | + | | <code>minecraft.crafted</code> | |
− | + | | 1 | |
− | + | | Items | |
− | + | |- | |
+ | | <code>minecraft.used</code> | ||
+ | | 2 | ||
+ | | Items | ||
+ | |- | ||
+ | | <code>minecraft.broken</code> | ||
+ | | 3 | ||
+ | | Items | ||
+ | |- | ||
+ | | <code>minecraft.picked_up</code> | ||
+ | | 4 | ||
+ | | Items | ||
+ | |- | ||
+ | | <code>minecraft.dropped</code> | ||
+ | | 5 | ||
+ | | Items | ||
|- | |- | ||
− | | | + | | <code>minecraft.killed</code> |
− | + | | 6 | |
− | + | | Entities | |
− | |||
− | | | ||
− | | | ||
|- | |- | ||
− | | | + | | <code>minecraft.killed_by</code> |
− | | | + | | 7 |
− | | | + | | Entities |
|- | |- | ||
− | | | + | | <code>minecraft.custom</code> |
− | | | + | | 8 |
− | | | + | | Custom |
|} | |} | ||
− | + | Blocks, Items, and Entities use block (not block state), item, and entity ids. | |
− | + | Custom has the following (unit only matters for clients): | |
{| class="wikitable" | {| class="wikitable" | ||
− | ! | + | ! Name |
− | + | ! ID | |
− | + | ! Unit | |
− | |||
− | ! | ||
− | ! | ||
|- | |- | ||
− | | | + | | <code>minecraft.leave_game</code> |
− | + | | 0 | |
− | + | | None | |
− | |||
− | | | ||
− | | | ||
|- | |- | ||
− | | | + | | <code>minecraft.play_one_minute</code> |
− | | | + | | 1 |
− | | | + | | Time |
|- | |- | ||
− | | | + | | <code>minecraft.time_since_death</code> |
− | + | | 2 | |
− | + | | Time | |
− | | | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | | | + | | <code>minecraft.sneak_Time</code> |
− | + | | 3 | |
− | + | | Time | |
− | |||
− | | | ||
− | | | ||
|- | |- | ||
− | | | + | | <code>minecraft.walk_one_cm</code> |
− | | | + | | 4 |
− | | | + | | Distance |
+ | |- | ||
+ | | <code>minecraft.crouch_one_cm</code> | ||
+ | | 5 | ||
+ | | Distance | ||
|- | |- | ||
− | | | + | | <code>minecraft.sprint_one_cm</code> |
− | | | + | | 6 |
− | | | + | | Distance |
|- | |- | ||
− | | | + | | <code>minecraft.swim_one_cm</code> |
− | + | | 7 | |
− | + | | Distance | |
− | | | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | | | + | | <code>minecraft.fall_one_cm</code> |
− | + | | 8 | |
− | + | | Distance | |
− | |||
− | | | ||
− | | | ||
|- | |- | ||
− | | | + | | <code>minecraft.climb_one_cm</code> |
− | + | | 9 | |
− | + | | Distance | |
− | | | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | | | + | | <code>minecraft.fly_one_cm</code> |
− | + | | 10 | |
− | + | | Distance | |
− | |||
− | | | ||
− | | | ||
|- | |- | ||
− | | | + | | <code>minecraft.dive_one_cm</code> |
− | | | + | | 11 |
− | | | + | | Distance |
|- | |- | ||
− | + | | <code>minecraft.minecart_one_cm</code> | |
− | + | | 12 | |
− | + | | Distance | |
− | |||
|- | |- | ||
− | | | + | | <code>minecraft.boat_one_cm</code> |
− | + | | 13 | |
− | | | + | | Distance |
− | | | ||
|- | |- | ||
− | | | + | | <code>minecraft.pig_one_cm</code> |
− | | | + | | 14 |
− | | | + | | Distance |
|- | |- | ||
− | | | + | | <code>minecraft.horse_one_cm</code> |
− | | | + | | 15 |
− | | | + | | Distance |
|- | |- | ||
− | | | + | | <code>minecraft.aviate_one_cm</code> |
− | | | + | | 16 |
− | | | + | | Distance |
|- | |- | ||
− | | | + | | <code>minecraft.jump</code> |
− | | | + | | 17 |
− | | | + | | None |
|- | |- | ||
− | | | + | | <code>minecraft.drop</code> |
− | | | + | | 18 |
− | | | + | | None |
− | |||
|- | |- | ||
− | | | + | | <code>minecraft.damage_dealt</code> |
− | | | + | | 19 |
− | | | + | | Damage |
− | |||
|- | |- | ||
− | | | + | | <code>minecraft.damage_taken</code> |
− | | | + | | 20 |
− | + | | Damage | |
− | | | ||
|- | |- | ||
− | | | + | | <code>minecraft.deaths</code> |
− | + | | 21 | |
− | | | + | | None |
− | | | ||
|- | |- | ||
− | | | + | | <code>minecraft.mob_kills</code> |
− | | | + | | 22 |
− | | | + | | None |
|- | |- | ||
− | | | + | | <code>minecraft.animals_bred</code> |
− | | | + | | 23 |
− | | | + | | None |
− | |||
|- | |- | ||
− | | | + | | <code>minecraft.player_kills</code> |
− | + | | 24 | |
− | + | | None | |
− | |||
− | |||
|- | |- | ||
− | | | + | | <code>minecraft.fish_caught</code> |
− | | | + | | 25 |
+ | | None | ||
|- | |- | ||
− | | | + | | <code>minecraft.talked_to_villager</code> |
− | | | + | | 26 |
+ | | None | ||
|- | |- | ||
− | | | + | | <code>minecraft.traded_with_villager</code> |
− | | | + | | 27 |
+ | | None | ||
|- | |- | ||
− | | | + | | <code>minecraft.eat_cake_slice</code> |
− | | | + | | 28 |
+ | | None | ||
|- | |- | ||
− | | | + | | <code>minecraft.fill_cauldron</code> |
− | | | + | | 29 |
+ | | None | ||
|- | |- | ||
− | | | + | | <code>minecraft.use_cauldron</code> |
− | | | + | | 30 |
+ | | None | ||
|- | |- | ||
− | | | + | | <code>minecraft.clean_armor</code> |
− | | | + | | 31 |
− | | | + | | None |
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | | | + | | <code>minecraft.clean_banner</code> |
− | | | + | | 32 |
+ | | None | ||
|- | |- | ||
− | | | + | | <code>minecraft.interact_with_brewingstand</code> |
− | | | + | | 33 |
+ | | None | ||
|- | |- | ||
− | | | + | | <code>minecraft.interact_with_beacon</code> |
− | | | + | | 34 |
+ | | None | ||
+ | |- | ||
+ | | <code>minecraft.inspect_dropper</code> | ||
+ | | 35 | ||
+ | | None | ||
+ | |- | ||
+ | | <code>minecraft.inspect_hopper</code> | ||
+ | | 36 | ||
+ | | None | ||
+ | |- | ||
+ | | <code>minecraft.inspect_dispenser</code> | ||
+ | | 37 | ||
+ | | None | ||
+ | |- | ||
+ | | <code>minecraft.play_noteblock</code> | ||
+ | | 38 | ||
+ | | None | ||
+ | |- | ||
+ | | <code>minecraft.tune_noteblock</code> | ||
+ | | 39 | ||
+ | | None | ||
+ | |- | ||
+ | | <code>minecraft.pot_flower</code> | ||
+ | | 40 | ||
+ | | None | ||
+ | |- | ||
+ | | <code>minecraft.trigger_trapped_chest</code> | ||
+ | | 41 | ||
+ | | None | ||
+ | |- | ||
+ | | <code>minecraft.open_enderchest</code> | ||
+ | | 42 | ||
+ | | None | ||
+ | |- | ||
+ | | <code>minecraft.enchant_item</code> | ||
+ | | 43 | ||
+ | | None | ||
+ | |- | ||
+ | | <code>minecraft.play_record</code> | ||
+ | | 44 | ||
+ | | None | ||
+ | |- | ||
+ | | <code>minecraft.interact_with_furnace</code> | ||
+ | | 45 | ||
+ | | None | ||
+ | |- | ||
+ | | <code>minecraft.interact_with_crafting_table</code> | ||
+ | | 46 | ||
+ | | None | ||
+ | |- | ||
+ | | <code>minecraft.open_chest</code> | ||
+ | | 47 | ||
+ | | None | ||
|- | |- | ||
− | | | + | | <code>minecraft.sleep_in_bed</code> |
− | | | + | | 48 |
+ | | None | ||
|- | |- | ||
− | | | + | | <code>minecraft.open_shulker_box</code> |
− | | | + | | 49 |
+ | | None | ||
|} | |} | ||
− | ==== | + | Units: |
+ | |||
+ | * None: just a normal number (formatted with 0 decimal places) | ||
+ | * Damage: value is 10 times the normal amount | ||
+ | * Distance: a distance in centimeters (hundredths of blocks) | ||
+ | * Time: a time span in ticks | ||
+ | |||
+ | ==== Block Break Animation ==== | ||
+ | |||
+ | 0–9 are the displayable destroy stages and each other number means that there is no animation on this coordinate. | ||
+ | |||
+ | Block break animations can still be applied on air; the animation will remain visible although there is no block being broken. However, if this is applied to a transparent block, odd graphical effects may happen, including water losing its transparency. (An effect similar to this can be seen in normal gameplay when breaking ice blocks) | ||
− | + | If you need to display several break animations at the same time you have to give each of them a unique Entity ID. The entity ID does not need to correspond to an actual entity on the client. It is valid to use a randomly generated number. | |
{| class="wikitable" | {| class="wikitable" | ||
Line 1,000: | Line 1,040: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan=" | + | |rowspan="3"| 0x08 |
− | |rowspan=" | + | |rowspan="3"| Play |
− | |rowspan=" | + | |rowspan="3"| Client |
− | | | + | | Entity ID |
− | | | + | | VarInt |
− | | | + | | Entity ID of the entity breaking the block |
+ | |- | ||
+ | | Location | ||
+ | | Position | ||
+ | | Block Position | ||
+ | |- | ||
+ | | Destroy Stage | ||
+ | | Byte | ||
+ | | 0–9 to set it, any other value to remove it | ||
|} | |} | ||
− | ==== | + | ==== Update Block Entity ==== |
− | + | Sets the block entity associated with the block at the given location. | |
{| class="wikitable" | {| class="wikitable" | ||
Line 1,020: | Line 1,068: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan=" | + | |rowspan="3"| 0x09 |
− | |rowspan=" | + | |rowspan="3"| Play |
− | |rowspan=" | + | |rowspan="3"| Client |
− | | | + | | Location |
− | | | + | | Position |
− | | | + | | |
+ | |- | ||
+ | | Action | ||
+ | | Unsigned Byte | ||
+ | | The type of update to perform, see below | ||
|- | |- | ||
− | | | + | | NBT Data |
− | | | + | | [[NBT|NBT Tag]] |
− | | | + | | Data to set. May be a TAG_END (0), in which case the block entity at the given location is removed (though this is not required since the client will remove the block entity automatically on chunk unload or block removal) |
|} | |} | ||
− | + | ''Action'' field: | |
− | + | * '''1''': Set data of a mob spawner (everything except for SpawnPotentials: current delay, min/max delay, mob to be spawned, spawn count, spawn range, etc.) | |
+ | * '''2''': Set command block text (command and last execution status) | ||
+ | * '''3''': Set the level, primary, and secondary powers of a beacon | ||
+ | * '''4''': Set rotation and skin of mob head | ||
+ | * '''5''': Declare a conduit | ||
+ | * '''6''': Set base color and patterns on a banner | ||
+ | * '''7''': Set the data for a Structure tile entity | ||
+ | * '''8''': Set the destination for a end gateway | ||
+ | * '''9''': Set the text on a sign | ||
+ | * '''10''': Unused | ||
+ | * '''11''': Declare a bed | ||
+ | * '''12''': Set data of a jigsaw block | ||
+ | * '''13''': Set items in a campfire | ||
− | + | ==== Block Action ==== | |
− | {| class="wikitable" | + | This packet is used for a number of actions and animations performed by blocks, usually non-persistent. |
+ | |||
+ | See [[Block Actions]] for a list of values. | ||
+ | |||
+ | {{Warning2|This packet uses a block ID, not a block state. Unfortunately, block IDs are not directly included in the output from [[Data Generators]], but can manually be calculated.}} | ||
+ | |||
+ | {| class="wikitable" | ||
! Packet ID | ! Packet ID | ||
! State | ! State | ||
Line 1,046: | Line 1,116: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan=" | + | |rowspan="4"| 0x0A |
− | |rowspan=" | + | |rowspan="4"| Play |
− | |rowspan=" | + | |rowspan="4"| Client |
− | | | + | | Location |
− | | [[ | + | | Position |
− | | | + | | Block coordinates |
+ | |- | ||
+ | | Action ID (Byte 1) | ||
+ | | Unsigned Byte | ||
+ | | Varies depending on block — see [[Block Actions]] | ||
+ | |- | ||
+ | | Action Param (Byte 2) | ||
+ | | Unsigned Byte | ||
+ | | Varies depending on block — see [[Block Actions]] | ||
|- | |- | ||
− | | | + | | Block Type |
− | | | + | | VarInt |
− | | | + | | The block type ID for the block. This must match the block at the given coordinates. |
|} | |} | ||
− | ==== | + | ==== Block Change ==== |
− | Fired whenever | + | Fired whenever a block is changed within the render distance. |
− | {{ | + | {{Warning2|Changing a block in a chunk that is not loaded is not a stable action. The Notchian client currently uses a ''shared'' empty chunk which is modified for all block changes in unloaded chunks; while in 1.9 this chunk never renders in older versions the changed block will appear in all copies of the empty chunk. Servers should avoid sending block changes in unloaded chunks and clients should ignore such packets.}} |
{| class="wikitable" | {| class="wikitable" | ||
Line 1,068: | Line 1,146: | ||
! State | ! State | ||
! Bound To | ! Bound To | ||
− | ! | + | ! Field Name |
− | ! | + | ! Field Type |
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan=" | + | |rowspan="2"| 0x0B |
− | |rowspan=" | + | |rowspan="2"| Play |
− | |rowspan=" | + | |rowspan="2"| Client |
− | | | + | | Location |
− | | | + | | Position |
− | + | | Block Coordinates | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | | | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| Block ID | | Block ID | ||
| VarInt | | VarInt | ||
− | | The new block state ID for the block as given in the {{Minecraft Wiki|Data values#Block IDs|global palette}} | + | | The new block state ID for the block as given in the {{Minecraft Wiki|Data values#Block IDs|global palette}}. See that section for more information. |
|} | |} | ||
− | + | ==== Boss Bar ==== | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | ==== | ||
− | |||
− | |||
{| class="wikitable" | {| class="wikitable" | ||
Line 1,118: | Line 1,168: | ||
! State | ! State | ||
! Bound To | ! Bound To | ||
− | ! Field Name | + | !colspan="2"| Field Name |
! Field Type | ! Field Type | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan=" | + | |rowspan="14"| 0x0C |
− | |rowspan=" | + | |rowspan="14"| Play |
− | |rowspan=" | + | |rowspan="14"| Client |
− | | | + | |colspan="2"| UUID |
− | | | + | | UUID |
− | | | + | | Unique ID for this bar |
|- | |- | ||
− | | Action | + | |colspan="2"| Action |
− | | | + | | VarInt Enum |
− | | | + | | Determines the layout of the remaining packet |
|- | |- | ||
− | + | ! Action | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | ! | ||
− | |||
− | |||
! Field Name | ! Field Name | ||
− | ! | + | ! |
− | ! | + | ! |
|- | |- | ||
− | | | + | |rowspan="5"| 0: add |
− | + | | Title | |
− | + | | [[Chat]] | |
− | + | | | |
− | | | ||
− | | | ||
− | | | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | | | + | | Health |
− | | | + | | Float |
− | | | + | | From 0 to 1. Values greater than 1 do not crash a Notchian client, and start [https://i.johni0702.de/nA.png rendering part of a second health bar] at around 1.5. |
− | |||
− | |||
− | |||
|- | |- | ||
− | | | + | | Color |
− | | | + | | VarInt Enum |
− | | | + | | Color ID (see below) |
− | |- | + | |- |
− | | | + | | Division |
+ | | VarInt Enum | ||
+ | | Type of division (see below) | ||
+ | |- | ||
+ | | Flags | ||
+ | | Unsigned Byte | ||
+ | | Bit mask. 0x1: should darken sky, 0x2: is dragon bar (used to play end music), 0x04: create fog (previously was also controlled by 0x02) | ||
+ | |- | ||
+ | | 1: remove | ||
+ | | ''no fields'' | ||
+ | | ''no fields'' | ||
+ | | Removes this boss bar | ||
+ | |- | ||
+ | | 2: update health | ||
+ | | Health | ||
+ | | Float | ||
+ | | as above | ||
+ | |- | ||
+ | | 3: update title | ||
+ | | Title | ||
| [[Chat]] | | [[Chat]] | ||
− | | | + | | |
+ | |- | ||
+ | |rowspan="2"| 4: update style | ||
+ | | Color | ||
+ | | VarInt Enum | ||
+ | | Color ID (see below) | ||
+ | |- | ||
+ | | Dividers | ||
+ | | VarInt Enum | ||
+ | | as above | ||
|- | |- | ||
− | | | + | | 5: update flags |
+ | | Flags | ||
| Unsigned Byte | | Unsigned Byte | ||
− | | | + | | as above |
|- | |- | ||
− | |||
− | |||
− | |||
|} | |} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
{| class="wikitable" | {| class="wikitable" | ||
− | ! | + | ! ID |
− | ! | + | ! Color |
− | + | |- | |
− | + | | 0 | |
− | + | | Pink | |
− | + | |- | |
+ | | 1 | ||
+ | | Blue | ||
+ | |- | ||
+ | | 2 | ||
+ | | Red | ||
+ | |- | ||
+ | | 3 | ||
+ | | Green | ||
|- | |- | ||
− | | | + | | 4 |
− | + | | Yellow | |
− | |||
− | |||
− | |||
− | | | ||
|- | |- | ||
− | | | + | | 5 |
− | | | + | | Purple |
− | |||
|- | |- | ||
− | | | + | | 6 |
− | + | | White | |
− | | | ||
|} | |} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
{| class="wikitable" | {| class="wikitable" | ||
− | ! | + | ! ID |
− | ! | + | ! Type of division |
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | | | + | | 0 |
− | | | + | | No division |
− | | | + | |- |
− | | | + | | 1 |
− | | | + | | 6 notches |
− | | | + | |- |
+ | | 2 | ||
+ | | 10 notches | ||
|- | |- | ||
− | | | + | | 3 |
− | | | + | | 12 notches |
− | |||
|- | |- | ||
− | | | + | | 4 |
− | | | + | | 20 notches |
− | |||
|} | |} | ||
− | + | ==== Server Difficulty ==== | |
+ | |||
+ | Changes the difficulty setting in the client's option menu | ||
{| class="wikitable" | {| class="wikitable" | ||
+ | ! Packet ID | ||
+ | ! State | ||
+ | ! Bound To | ||
+ | ! Field Name | ||
+ | ! Field Type | ||
+ | ! Notes | ||
|- | |- | ||
− | + | |rowspan="2"| 0x0D | |
− | + | |rowspan="2"| Play | |
− | + | |rowspan="2"| Client | |
+ | | Difficulty | ||
+ | | Unsigned Byte | ||
+ | | 0: peaceful, 1: easy, 2: normal, 3: hard | ||
|- | |- | ||
− | | | + | | Difficulty locked? |
− | | | + | | Boolean |
− | | | + | | |
− | |- | + | |} |
− | | | + | |
− | + | ==== Chat Message (clientbound) ==== | |
+ | |||
+ | Identifying the difference between Chat/System Message is important as it helps respect the user's chat visibility options. See [[Chat#Processing chat|processing chat]] for more info about these positions. | ||
+ | |||
+ | {{warning2|Game info accepts json formatting but does not display it, although the deprecated §-based formatting works. This is not an issue when using the [[#Title|Title]] packet, so prefer that packet for displaying information in that slot. See [https://bugs.mojang.com/browse/MC-119145 MC-119145] for more information.}} | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! Packet ID | ||
+ | ! State | ||
+ | ! Bound To | ||
+ | ! Field Name | ||
+ | ! Field Type | ||
+ | ! Notes | ||
|- | |- | ||
− | | 2 | + | |rowspan="2"| 0x0E |
− | | | + | |rowspan="2"| Play |
+ | |rowspan="2"| Client | ||
+ | | JSON Data | ||
+ | | [[Chat]] | ||
+ | | Limited to 32767 bytes | ||
|- | |- | ||
− | | | + | | Position |
− | | | + | | Byte |
+ | | 0: chat (chat box), 1: system message (chat box), 2: game info (above hotbar). | ||
+ | |} | ||
+ | |||
+ | ==== Multi Block Change ==== | ||
+ | |||
+ | Fired whenever 2 or more blocks are changed within the same chunk on the same tick. | ||
+ | |||
+ | {{Warning|Changing blocks in chunks not loaded by the client is unsafe (see note on [[#Block Change|Block Change]]).}} | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! Packet ID | ||
+ | ! State | ||
+ | ! Bound To | ||
+ | !colspan="2"| Field Name | ||
+ | !colspan="2"| Field Type | ||
+ | ! Notes | ||
|- | |- | ||
− | |rowspan=" | + | |rowspan="6"| 0x0F |
− | | | + | |rowspan="6"| Play |
− | |rowspan=" | + | |rowspan="6"| Client |
+ | |colspan="2"| Chunk X | ||
+ | |colspan="2"| Int | ||
+ | | Chunk X coordinate | ||
|- | |- | ||
− | | | + | |colspan="2"| Chunk Z |
+ | |colspan="2"| Int | ||
+ | | Chunk Z coordinate | ||
|- | |- | ||
− | | 2 | + | |colspan="2"| Record Count |
+ | |colspan="2"| VarInt | ||
+ | | Number of elements in the following array, i.e. the number of blocks affected | ||
|- | |- | ||
− | | 3 | + | |rowspan="3"| Record |
− | | | + | | Horizontal Position |
+ | |rowspan="3"| Array | ||
+ | | Unsigned Byte | ||
+ | | The 4 most significant bits (<code>0xF0</code>) encode the X coordinate, relative to the chunk. The 4 least significant bits (<code>0x0F</code>) encode the Z coordinate, relative to the chunk. | ||
|- | |- | ||
− | | | + | | Y Coordinate |
− | | | + | | Unsigned Byte |
+ | | Y coordinate of the block | ||
|- | |- | ||
− | | | + | | Block ID |
+ | | VarInt | ||
+ | | The new block state ID for the block as given in the {{Minecraft Wiki|Data values#Block IDs|global palette}}. See that section for more information. | ||
+ | |} | ||
+ | |||
+ | To decode the position into a world position: | ||
+ | |||
+ | <syntaxhighlight lang="java"> | ||
+ | worldX = (horizPos >> 4 & 15) + (chunkX * 16); | ||
+ | worldY = vertPos; | ||
+ | worldZ = (horizPos & 15) + (chunkZ * 16); | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ==== Tab-Complete (clientbound) ==== | ||
+ | |||
+ | The server responds with a list of auto-completions of the last word sent to it. In the case of regular chat, this is a player username. Command names and parameters are also supported. The client sorts these alphabetically before listing them. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! Packet ID | ||
+ | ! State | ||
+ | ! Bound To | ||
+ | !colspan="2"| Field Name | ||
+ | !colspan="2"| Field Type | ||
+ | ! Notes | ||
|- | |- | ||
− | | | + | |rowspan="8"| 0x10 |
+ | |rowspan="8"| Play | ||
+ | |rowspan="8"| Client | ||
|- | |- | ||
− | | | + | |colspan="2"| ID |
− | | | + | |colspan="2"| VarInt |
+ | | Transaction ID | ||
|- | |- | ||
− | | | + | |colspan="2"| Start |
+ | |colspan="2"| VarInt | ||
+ | | Start of the text to replace | ||
|- | |- | ||
− | | | + | |colspan="2"| Length |
+ | |colspan="2"| VarInt | ||
+ | | Length of the text to replace | ||
|- | |- | ||
− | | | + | |colspan="2"| Count |
− | | | + | |colspan="2"| VarInt |
− | | | + | | Number of elements in the following array |
|- | |- | ||
− | | | + | |rowspan="3"| Matches |
− | | | + | | Match |
+ | |rowspan="3"| Array | ||
+ | | String (32767) | ||
+ | | One eligible value to insert, note that each command is sent separately instead of in a single string, hence the need for Count. Note that for instance this doesn't include a leading <code>/</code> on commands. | ||
|- | |- | ||
− | | | + | | Has tooltip |
− | | | + | | Boolean |
− | | | + | | True if the following is present |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | | | + | | Tooltip |
− | | | + | | Optional [[Chat]] |
+ | | Tooltip to display; only present if previous boolean is true | ||
|} | |} | ||
− | ==== | + | ==== Declare Commands ==== |
+ | |||
+ | Lists all of the commands on the server, and how they are parsed. | ||
− | + | This is a directed graph, with one root node. Each redirect or child node must refer only to nodes that have already been declared. | |
{| class="wikitable" | {| class="wikitable" | ||
Line 1,335: | Line 1,449: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan="3"| | + | |rowspan="3"| 0x11 |
|rowspan="3"| Play | |rowspan="3"| Play | ||
|rowspan="3"| Client | |rowspan="3"| Client | ||
− | | | + | | Count |
− | | | + | | VarInt |
− | | | + | | Number of elements in the following array |
|- | |- | ||
− | | | + | | Nodes |
− | | | + | | Array of [[Command Data|Node]] |
− | | | + | | An array of nodes |
|- | |- | ||
− | | | + | | Root index |
− | | | + | | VarInt |
− | | | + | | Index of the <code>root</code> node in the previous array |
|} | |} | ||
− | + | For more information on this packet, see the [[Command Data]] article. | |
− | + | ==== Confirm Transaction (clientbound) ==== | |
− | + | A packet from the server indicating whether a request from the client was accepted, or whether there was a conflict (due to lag). If the packet was not accepted, the client must respond with a [[#Confirm Transaction (serverbound)|serverbound confirm transaction]] packet. | |
− | |||
− | |||
{| class="wikitable" | {| class="wikitable" | ||
Line 1,367: | Line 1,479: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan=" | + | |rowspan="3"| 0x12 |
− | |rowspan=" | + | |rowspan="3"| Play |
− | |rowspan=" | + | |rowspan="3"| Client |
− | | | + | | Window ID |
− | | | + | | Byte |
− | | | + | | The ID of the window that the action occurred in |
+ | |- | ||
+ | | Action Number | ||
+ | | Short | ||
+ | | Every action that is to be accepted has a unique number. This number is an incrementing integer (starting at 0) with separate counts for each window ID. | ||
|- | |- | ||
− | | | + | | Accepted |
− | | | + | | Boolean |
− | | | + | | Whether the action was accepted |
|} | |} | ||
− | ==== | + | ==== Close Window (clientbound) ==== |
− | + | This packet is sent from the server to the client when a window is forcibly closed, such as when a chest is destroyed while it's open. | |
− | |||
− | |||
− | |||
− | |||
{| class="wikitable" | {| class="wikitable" | ||
Line 1,395: | Line 1,507: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | | | + | | 0x13 |
− | + | | Play | |
− | + | | Client | |
− | | | + | | Window ID |
− | + | | Unsigned Byte | |
− | + | | This is the ID of the window that was closed. 0 for inventory. | |
− | |||
− | |||
− | | Byte | ||
− | | | ||
|} | |} | ||
− | ==== | + | ==== Window Items ==== |
− | + | [[File:Inventory-slots.png|thumb|The inventory slots]] | |
− | + | Sent by the server when items in multiple slots (in a window) are added/removed. This includes the main inventory, equipped armour and crafting slots. | |
{| class="wikitable" | {| class="wikitable" | ||
Line 1,420: | Line 1,528: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan=" | + | |rowspan="3"| 0x14 |
− | |rowspan=" | + | |rowspan="3"| Play |
− | |rowspan=" | + | |rowspan="3"| Client |
− | | | + | | Window ID |
− | | | + | | Unsigned Byte |
− | | | + | | The ID of window which items are being sent for. 0 for player inventory. |
|- | |- | ||
− | | | + | | Count |
− | | | + | | Short |
− | | | + | | Number of elements in the following array |
|- | |- | ||
− | | | + | | Slot Data |
− | + | | Array of [[Slot Data|Slot]] | |
− | + | | | |
− | |||
− | |||
− | |||
− | | | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | | | ||
|} | |} | ||
− | ==== | + | See [[Inventory#Windows|inventory windows]] for further information about how slots are indexed. |
+ | |||
+ | ==== Window Property ==== | ||
− | + | This packet is used to inform the client that part of a GUI window should be updated. | |
{| class="wikitable" | {| class="wikitable" | ||
Line 1,464: | Line 1,558: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | | | + | |rowspan="3"| 0x15 |
− | + | |rowspan="3"| Play | |
− | | | + | |rowspan="3"| Client |
− | + | | Window ID | |
− | + | | Unsigned Byte | |
− | + | | | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | | | + | | Property |
− | + | | Short | |
− | + | | The property to be updated, see below | |
− | |||
− | | | ||
− | | | ||
|- | |- | ||
− | | | + | | Value |
− | | | + | | Short |
− | | | + | | The new value for the property, see below |
|} | |} | ||
− | + | The meaning of the Property field depends on the type of the window. The following table shows the known combinations of window type and property, and how the value is to be interpreted. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
{| class="wikitable" | {| class="wikitable" | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | | | + | ! Window type |
− | |rowspan=" | + | ! Property |
− | | | + | ! Value |
− | | | + | |- |
− | | | + | |rowspan="4"| Furnace |
− | | | + | | 0: Fire icon (fuel left) |
+ | | counting from fuel burn time down to 0 (in-game ticks) | ||
+ | |- | ||
+ | | 1: Maximum fuel burn time | ||
+ | | fuel burn time or 0 (in-game ticks) | ||
|- | |- | ||
− | | | + | | 2: Progress arrow |
− | + | | counting from 0 to maximum progress (in-game ticks) | |
− | | | ||
|- | |- | ||
− | | | + | | 3: Maximum progress |
− | + | | always 200 on the notchian server | |
− | | | ||
|- | |- | ||
− | | | + | |rowspan="10"| Enchantment Table |
− | | | + | | 0: Level requirement for top enchantment slot |
− | | | + | |rowspan="3"| The enchantment's xp level requirement |
|- | |- | ||
− | | | + | | 1: Level requirement for middle enchantment slot |
− | |||
− | |||
|- | |- | ||
− | | | + | | 2: Level requirement for bottom enchantment slot |
− | |||
− | |||
|- | |- | ||
− | | | + | | 3: The enchantment seed |
− | | | + | | Used for drawing the enchantment names (in [[Wikipedia:Standard Galactic Alphabet|SGA]]) clientside. The same seed ''is'' used to calculate enchantments, but some of the data isn't sent to the client to prevent easily guessing the entire list (the seed value here is the regular seed bitwise and <code>0xFFFFFFF0</code>). |
− | |||
|- | |- | ||
− | | | + | | 4: Enchantment ID shown on mouse hover over top enchantment slot |
− | | | + | |rowspan="3"| The enchantment id (set to -1 to hide it), see below for values |
− | |||
|- | |- | ||
− | | | + | | 5: Enchantment ID shown on mouse hover over middle enchantment slot |
− | | | + | |- |
− | | | + | | 6: Enchantment ID shown on mouse hover over bottom enchantment slot |
− | |} | + | |- |
+ | | 7: Enchantment level shown on mouse hover over the top slot | ||
+ | |rowspan="3"| The enchantment level (1 = I, 2 = II, 6 = VI, etc.), or -1 if no enchant | ||
+ | |- | ||
+ | | 8: Enchantment level shown on mouse hover over the middle slot | ||
+ | |- | ||
+ | | 9: Enchantment level shown on mouse hover over the bottom slot | ||
+ | |- | ||
+ | |rowspan="3"| Beacon | ||
+ | | 0: Power level | ||
+ | | 0-4, controls what effect buttons are enabled | ||
+ | |- | ||
+ | | 1: First potion effect | ||
+ | | {{Minecraft Wiki|Data values#Status effects|Potion effect ID}} for the first effect, or -1 if no effect | ||
+ | |- | ||
+ | | 2: Second potion effect | ||
+ | | {{Minecraft Wiki|Data values#Status effects|Potion effect ID}} for the second effect, or -1 if no effect | ||
+ | |- | ||
+ | | Anvil | ||
+ | | 0: Repair cost | ||
+ | | The repair's cost in xp levels | ||
+ | |- | ||
+ | |rowspan="2"| Brewing Stand | ||
+ | | 0: Brew time | ||
+ | | 0 – 400, with 400 making the arrow empty, and 0 making the arrow full | ||
+ | |- | ||
+ | | 1: Fuel time | ||
+ | | 0 - 20, with 0 making the arrow empty, and 20 making the arrow full | ||
+ | |} | ||
− | + | For an enchanting table, the following numerical IDs are used: | |
− | |||
− | |||
{| class="wikitable" | {| class="wikitable" | ||
− | ! | + | ! Numerical ID |
− | ! | + | ! Enchantment ID |
− | ! | + | ! Enchantment Name |
− | |||
− | |||
− | |||
|- | |- | ||
− | | | + | | 0 |
− | + | | minecraft:protection | |
− | + | | Protection | |
− | |||
− | | | ||
− | | | ||
|- | |- | ||
− | | | + | | 1 |
− | + | | minecraft:fire_protection | |
− | + | | Fire Protection | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | | | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | | | ||
|- | |- | ||
| 2 | | 2 | ||
− | | | + | | minecraft:feather_falling |
− | | | + | | Feather Falling |
|- | |- | ||
| 3 | | 3 | ||
− | | | + | | minecraft:blast_protection |
− | | | + | | Blast Protection |
|- | |- | ||
| 4 | | 4 | ||
− | | | + | | minecraft:projectile_protection |
− | | | + | | Projectile Protection |
|- | |- | ||
| 5 | | 5 | ||
− | | | + | | minecraft:respiration |
− | | | + | | Respiration |
− | |- | + | |- |
| 6 | | 6 | ||
− | | | + | | minecraft:aqua_affinity |
− | | | + | | Aqua Affinity |
|- | |- | ||
| 7 | | 7 | ||
− | | | + | | minecraft:thorns |
− | | | + | | Thorns |
|- | |- | ||
| 8 | | 8 | ||
− | | | + | | minecraft:depth_strider |
− | | | + | | Depth Strider |
+ | |- | ||
+ | | 9 | ||
+ | | minecraft:frost_walker | ||
+ | | Frost Walker | ||
|- | |- | ||
| 10 | | 10 | ||
− | | | + | | minecraft:binding_curse |
− | | | + | | Curse of Binding |
− | | | + | |- |
− | + | | 11 | |
− | + | | minecraft:sharpness | |
− | + | | Sharpness | |
− | + | |- | |
− | + | | 12 | |
− | + | | minecraft:smite | |
− | + | | Smite | |
− | + | |- | |
− | + | | 13 | |
− | + | | minecraft:bane_of_arthropods | |
− | + | | Bane of Arthropods | |
− | + | |- | |
− | + | | 14 | |
− | + | | minecraft:knockback | |
+ | | Knockback | ||
+ | |- | ||
+ | | 15 | ||
+ | | minecraft:fire_aspect | ||
+ | | Fire Aspect | ||
|- | |- | ||
− | | | + | | 16 |
− | | | + | | minecraft:looting |
− | | | + | | Looting |
− | | | + | |- |
− | | | + | | 17 |
− | | | + | | minecraft:sweeping |
− | |} | + | | Sweeping Edge |
− | + | |- | |
− | ==== | + | | 18 |
− | + | | minecraft:efficiency | |
− | + | | Efficiency | |
+ | |- | ||
+ | | 19 | ||
+ | | minecraft:silk_touch | ||
+ | | Silk Touch | ||
+ | |- | ||
+ | | 20 | ||
+ | | minecraft:unbreaking | ||
+ | | Unbreaking | ||
+ | |- | ||
+ | | 21 | ||
+ | | minecraft:fortune | ||
+ | | Fortune | ||
+ | |- | ||
+ | | 22 | ||
+ | | minecraft:power | ||
+ | | Power | ||
+ | |- | ||
+ | | 23 | ||
+ | | minecraft:punch | ||
+ | | Punch | ||
+ | |- | ||
+ | | 24 | ||
+ | | minecraft:flame | ||
+ | | Flame | ||
+ | |- | ||
+ | | 25 | ||
+ | | minecraft:infinity | ||
+ | | Infinity | ||
+ | |- | ||
+ | | 26 | ||
+ | | minecraft:luck_of_the_sea | ||
+ | | Luck of the Sea | ||
+ | |- | ||
+ | | 27 | ||
+ | | minecraft:lure | ||
+ | | Lure | ||
+ | |- | ||
+ | | 28 | ||
+ | | minecraft:loyalty | ||
+ | | Loyalty | ||
+ | |- | ||
+ | | 29 | ||
+ | | minecraft:impaling | ||
+ | | Impaling | ||
+ | |- | ||
+ | | 30 | ||
+ | | minecraft:riptide | ||
+ | | Riptide | ||
+ | |- | ||
+ | | 31 | ||
+ | | minecraft:channeling | ||
+ | | Channeling | ||
+ | |- | ||
+ | | 32 | ||
+ | | minecraft:mending | ||
+ | | Mending | ||
+ | |- | ||
+ | | 33 | ||
+ | | minecraft:vanishing_curse | ||
+ | | Curse of Vanishing | ||
+ | |} | ||
+ | |||
+ | ==== Set Slot ==== | ||
− | + | Sent by the server when an item in a slot (in a window) is added/removed. | |
{| class="wikitable" | {| class="wikitable" | ||
Line 1,686: | Line 1,798: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan=" | + | |rowspan="3"| 0x16 |
− | |rowspan=" | + | |rowspan="3"| Play |
− | |rowspan=" | + | |rowspan="3"| Client |
− | | | + | | Window ID |
− | | | + | | Byte |
− | | | + | | The window which is being updated. 0 for player inventory. Note that all known window types include the player inventory. This packet will only be sent for the currently opened window while the player is performing actions, even if it affects the player inventory. After the window is closed, a number of these packets are sent to update the player's inventory window (0). |
|- | |- | ||
− | | | + | | Slot |
− | | | + | | Short |
− | | | + | | The slot that should be updated |
|- | |- | ||
− | | | + | | Slot Data |
− | + | | [[Slot Data|Slot]] | |
− | + | | | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | | | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | | | ||
|} | |} | ||
− | + | To set the cursor (the item currently dragged with the mouse), use -1 as Window ID and as Slot. | |
+ | |||
+ | This packet can only be used to edit the hotbar of the player's inventory if window ID is set to 0 (slots 36 through 44). If the window ID is set to -2, then any slot in the inventory can be used but no add item animation will be played. | ||
− | + | ==== Set Cooldown ==== | |
− | + | Applies a cooldown period to all items with the given type. Used by the Notchian server with enderpearls. This packet should be sent when the cooldown starts and also when the cooldown ends (to compensate for lag), although the client will end the cooldown automatically. Can be applied to any item, note that interactions still get sent to the server with the item but the client does not play the animation nor attempt to predict results (i.e block placing). | |
{| class="wikitable" | {| class="wikitable" | ||
Line 1,736: | Line 1,830: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan=" | + | |rowspan="2"| 0x17 |
− | |rowspan=" | + | |rowspan="2"| Play |
− | |rowspan=" | + | |rowspan="2"| Client |
− | | | + | | Item ID |
− | | | + | | VarInt |
− | | | + | | Numeric ID of the item to apply a cooldown to. |
|- | |- | ||
− | | | + | | Cooldown Ticks |
− | | | + | | VarInt |
− | | | + | | Number of ticks to apply a cooldown for, or 0 to clear the cooldown. |
+ | |} | ||
+ | |||
+ | ==== Plugin Message (clientbound) ==== | ||
+ | |||
+ | {{Main|Plugin channels}} | ||
+ | |||
+ | Mods and plugins can use this to send their data. Minecraft itself uses several [[plugin channel]]s. These internal channels are in the <code>minecraft</code> namespace. | ||
+ | |||
+ | More documentation on this: [http://dinnerbone.com/blog/2012/01/13/minecraft-plugin-channels-messaging/ http://dinnerbone.com/blog/2012/01/13/minecraft-plugin-channels-messaging/] | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! Packet ID | ||
+ | ! State | ||
+ | ! Bound To | ||
+ | ! Field Name | ||
+ | ! Field Type | ||
+ | ! Notes | ||
+ | |- | ||
+ | |rowspan="2"| 0x18 | ||
+ | |rowspan="2"| Play | ||
+ | |rowspan="2"| Client | ||
+ | | Channel | ||
+ | | Identifier | ||
+ | | Name of the [[plugin channel]] used to send the data | ||
|- | |- | ||
| Data | | Data | ||
− | | | + | | Byte Array |
− | | | + | | Any data, depending on the channel. <code>minecraft:</code> channels are documented [[plugin channel|here]]. The length of this array must be inferred from the packet length. |
− | |||
− | |||
− | |||
− | |||
|} | |} | ||
− | Effect | + | ==== Named Sound Effect ==== |
+ | {{See also|#Sound Effect}} | ||
+ | |||
+ | Used to play a sound effect on the client. Custom sounds may be added by resource packs. | ||
{| class="wikitable" | {| class="wikitable" | ||
− | ! ID | + | ! Packet ID |
− | ! Name | + | ! State |
− | ! | + | ! Bound To |
+ | ! Field Name | ||
+ | ! Field Type | ||
+ | ! Notes | ||
|- | |- | ||
− | + | |rowspan="7"| 0x19 | |
+ | |rowspan="7"| Play | ||
+ | |rowspan="7"| Client | ||
+ | | Sound Name | ||
+ | | Identifier | ||
+ | | All sound effect names as of 1.14.4 can be seen [https://pokechu22.github.io/Burger/1.14.4.html#sounds here]. | ||
|- | |- | ||
− | | | + | | Sound Category |
− | | | + | | VarInt Enum |
− | | | + | | The category that this sound will be played from ([https://gist.github.com/konwboj/7c0c380d3923443e9d55 current categories]) |
|- | |- | ||
− | | | + | | Effect Position X |
− | | | + | | Int |
− | | | + | | Effect X multiplied by 8 ([[Data types#Fixed-point numbers|fixed-point number]] with only 3 bits dedicated to the fractional part) |
|- | |- | ||
− | | | + | | Effect Position Y |
− | | | + | | Int |
− | | | + | | Effect Y multiplied by 8 ([[Data types#Fixed-point numbers|fixed-point number]] with only 3 bits dedicated to the fractional part) |
|- | |- | ||
− | | | + | | Effect Position Z |
− | | | + | | Int |
− | | | + | | Effect Z multiplied by 8 ([[Data types#Fixed-point numbers|fixed-point number]] with only 3 bits dedicated to the fractional part) |
|- | |- | ||
− | | | + | | Volume |
− | | | + | | Float |
− | | | + | | 1 is 100%, can be more |
|- | |- | ||
− | | | + | | Pitch |
− | | | + | | Float |
− | | | + | | Float between 0.5 and 2.0 by Notchian clients |
− | | | + | |} |
− | + | ||
− | + | ==== Disconnect (play) ==== | |
− | + | ||
+ | Sent by the server before it disconnects a client. The client assumes that the server has already closed the connection by the time the packet arrives. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! Packet ID | ||
+ | ! State | ||
+ | ! Bound To | ||
+ | ! Field Name | ||
+ | ! Field Type | ||
+ | ! Notes | ||
|- | |- | ||
− | | | + | | 0x1A |
− | | | + | | Play |
− | | | + | | Client |
+ | | Reason | ||
+ | | [[Chat]] | ||
+ | | Displayed to the client when the connection terminates. | ||
+ | |} | ||
+ | |||
+ | ==== Entity Status ==== | ||
+ | |||
+ | Entity statuses generally trigger an animation for an entity. The available statuses vary by the entity's type (and are available to subclasses of that type as well). | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! Packet ID | ||
+ | ! State | ||
+ | ! Bound To | ||
+ | ! Field Name | ||
+ | ! Field Type | ||
+ | ! Notes | ||
|- | |- | ||
− | | | + | |rowspan="2"| 0x1B |
− | | | + | |rowspan="2"| Play |
+ | |rowspan="2"| Client | ||
+ | | Entity ID | ||
+ | | Int | ||
| | | | ||
|- | |- | ||
− | | | + | | Entity Status |
− | | | + | | Byte Enum |
− | | | + | | See below |
− | | | + | |} |
− | + | ||
− | + | See [[Entity statuses]] for a list of which statuses are valid for each type of entity. | |
− | + | ||
+ | ==== Explosion ==== | ||
+ | |||
+ | Sent when an explosion occurs (creepers, TNT, and ghast fireballs). | ||
+ | |||
+ | Each block in Records is set to air. Coordinates for each axis in record is int(X) + record.x | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! Packet ID | ||
+ | ! State | ||
+ | ! Bound To | ||
+ | ! Field Name | ||
+ | ! Field Type | ||
+ | ! Notes | ||
|- | |- | ||
− | | | + | |rowspan="9"| 0x1C |
− | | | + | |rowspan="9"| Play |
+ | |rowspan="9"| Client | ||
+ | | X | ||
+ | | Float | ||
| | | | ||
|- | |- | ||
− | | | + | | Y |
− | | | + | | Float |
| | | | ||
|- | |- | ||
− | | | + | | Z |
− | | | + | | Float |
| | | | ||
|- | |- | ||
− | | | + | | Radius |
− | | | + | | Float |
− | | | + | | Currently unused in the client |
|- | |- | ||
− | | | + | | Record Count |
− | | | + | | Int |
− | | | + | | Number of elements in the following array |
|- | |- | ||
− | | | + | | Records |
− | | | + | | Array of (Byte, Byte, Byte) |
− | | | + | | Each record is 3 signed bytes long, each bytes are the XYZ (respectively) offsets of affected blocks. |
|- | |- | ||
− | | | + | | Player Motion X |
− | | | + | | Float |
− | | | + | | X velocity of the player being pushed by the explosion |
|- | |- | ||
− | | | + | | Player Motion Y |
− | | | + | | Float |
− | | | + | | Y velocity of the player being pushed by the explosion |
|- | |- | ||
− | | | + | | Player Motion Z |
− | | | + | | Float |
− | | | + | | Z velocity of the player being pushed by the explosion |
+ | |} | ||
+ | |||
+ | ==== Unload Chunk ==== | ||
+ | |||
+ | Tells the client to unload a chunk column. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! Packet ID | ||
+ | ! State | ||
+ | ! Bound To | ||
+ | ! Field Name | ||
+ | ! Field Type | ||
+ | ! Notes | ||
|- | |- | ||
− | | | + | |rowspan="2"| 0x1D |
− | | | + | |rowspan="2"| Play |
− | | | + | |rowspan="2"| Client |
+ | | Chunk X | ||
+ | | Int | ||
+ | | Block coordinate divided by 16, rounded down | ||
|- | |- | ||
− | | | + | | Chunk Z |
− | | | + | | Int |
− | | | + | | Block coordinate divided by 16, rounded down |
− | | | + | |} |
− | + | ||
− | + | It is legal to send this packet even if the given chunk is not currently loaded. | |
− | + | ||
+ | ==== Change Game State ==== | ||
+ | |||
+ | Used for a wide variety of game state things, from whether to bed use to gamemode to demo messages. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! Packet ID | ||
+ | ! State | ||
+ | ! Bound To | ||
+ | ! Field Name | ||
+ | ! Field Type | ||
+ | ! Notes | ||
|- | |- | ||
− | | | + | |rowspan="2"| 0x1E |
− | | | + | |rowspan="2"| Play |
− | | | + | |rowspan="2"| Client |
+ | | Reason | ||
+ | | Unsigned Byte | ||
+ | | See below | ||
|- | |- | ||
− | | | + | | Value |
− | | | + | | Float |
− | | | + | | Depends on Reason |
+ | |} | ||
+ | |||
+ | ''Reason codes'': | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! Reason | ||
+ | ! Effect | ||
+ | ! Value | ||
|- | |- | ||
− | | | + | | 0 |
− | | | + | | Invalid Bed |
− | | | + | | Would be used to switch between messages, but the only used message is 0 for invalid bed |
|- | |- | ||
− | | | + | | 1 |
− | | | + | | End raining |
− | | | + | | |
|- | |- | ||
− | | | + | | 2 |
− | | | + | | Begin raining |
− | | | + | | |
|- | |- | ||
− | | | + | | 3 |
− | | | + | | Change gamemode |
− | | | + | | 0: Survival, 1: Creative, 2: Adventure, 3: Spectator |
|- | |- | ||
− | | | + | | 4 |
− | | | + | | Exit end |
− | | | + | | 0: Immediately send Client Status of respawn without showing end credits; 1: Show end credits and respawn at the end (or when esc is pressed). 1 is sent if the player has not yet received the "The end?" advancement, while if they do have it 0 is used. |
|- | |- | ||
− | | | + | | 5 |
− | | | + | | Demo message |
− | | | + | | 0: Show welcome to demo screen, 101: Tell movement controls, 102: Tell jump control, 103: Tell inventory control |
+ | |- | ||
+ | | 6 | ||
+ | | Arrow hitting player | ||
+ | | Appears to be played when an arrow strikes another player in Multiplayer | ||
|- | |- | ||
− | | | + | | 7 |
− | | | + | | Fade value |
− | | | + | | The current darkness value. 1 = Dark, 0 = Bright, Setting the value higher causes the game to change color and freeze |
|- | |- | ||
− | | | + | | 8 |
− | | | + | | Fade time |
− | | | + | | Time in ticks for the sky to fade |
|- | |- | ||
− | | | + | | 9 |
− | + | | Play pufferfish sting sound | |
− | | | ||
|- | |- | ||
− | | | + | | 10 |
− | | | + | | Play elder guardian mob appearance (effect and sound) |
| | | | ||
− | |- | + | |} |
− | | | + | |
− | | | + | ==== Open Horse Window ==== |
+ | |||
+ | This packet is used exclusively for opening the horse GUI. [[#Open Window|Open Window]] is used for all other GUIs. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! Packet ID | ||
+ | ! State | ||
+ | ! Bound To | ||
+ | ! Field Name | ||
+ | ! Field Type | ||
+ | ! Notes | ||
+ | |- | ||
+ | |rowspan="3"| 0x1F | ||
+ | |rowspan="3"| Play | ||
+ | |rowspan="3"| Client | ||
+ | | Window ID? | ||
+ | | Byte | ||
| | | | ||
|- | |- | ||
− | | | + | | Number of slots? |
− | | | + | | VarInt |
− | | | + | | |
|- | |- | ||
− | | | + | | Entity ID? |
− | | | + | | Integer |
| | | | ||
+ | |} | ||
+ | |||
+ | ==== Keep Alive (clientbound) ==== | ||
+ | |||
+ | The server will frequently send out a keep-alive, each containing a random ID. The client must respond with the same packet. If the client does not respond to them for over 30 seconds, the server kicks the client. Vice versa, if the server does not send any keep-alives for 20 seconds, the client will disconnect and yields a "Timed out" exception. | ||
+ | |||
+ | The Notchian server uses a system-dependent time in milliseconds to generate the keep alive ID value. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! Packet ID | ||
+ | ! State | ||
+ | ! Bound To | ||
+ | ! Field Name | ||
+ | ! Field Type | ||
+ | ! Notes | ||
|- | |- | ||
− | + | |rowspan="1"| 0x20 | |
− | | | + | |rowspan="1"| Play |
− | | | + | |rowspan="1"| Client |
− | | | + | | Keep Alive ID |
− | | | + | | Long |
− | | | + | | |
− | | | + | |} |
− | + | ||
− | + | ==== Chunk Data ==== | |
+ | {{Main|Chunk Format}} | ||
+ | {{See also|#Unload Chunk}} | ||
+ | |||
+ | The server only sends skylight information for chunk pillars in the {{Minecraft Wiki|Overworld}}, it's up to the client to know in which dimenison the player is currently located. You can also infer this information from the primary bitmask and the amount of uncompressed bytes sent. This packet also sends all block entities in the chunk (though sending them is not required; it is still legal to send them with [[#Update Block Entity|Update Block Entity]] later). | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! Packet ID | ||
+ | ! State | ||
+ | ! Bound To | ||
+ | ! Field Name | ||
+ | ! Field Type | ||
+ | ! Notes | ||
|- | |- | ||
− | | | + | |rowspan="9"| 0x21 |
− | | | + | |rowspan="9"| Play |
− | | | + | |rowspan="9"| Client |
+ | | Chunk X | ||
+ | | Int | ||
+ | | Chunk coordinate (block coordinate divided by 16, rounded down) | ||
|- | |- | ||
− | | | + | | Chunk Z |
− | | | + | | Int |
− | | | + | | Chunk coordinate (block coordinate divided by 16, rounded down) |
|- | |- | ||
− | | | + | | Full chunk |
− | | | + | | Boolean |
− | | | + | | See [[Chunk Format#Full chunk|Chunk Format]] |
|- | |- | ||
− | | | + | | Primary Bit Mask |
− | | | + | | VarInt |
− | | | + | | Bitmask with bits set to 1 for every 16×16×16 chunk section whose data is included in Data. The least significant bit represents the chunk section at the bottom of the chunk column (from y=0 to y=15). |
|- | |- | ||
− | | | + | | Heightmaps |
− | | | + | | [[NBT]] |
− | | | + | | Compound containing one long array named <code>MOTION_BLOCKING</code>, which is a heightmap for the highest solid block at each position in the chunk (as a compacted long array with 256 entries at 9 bits per entry totaling 36 longs). The Notchian server also adds a <code>WORLD_SURFACE</code> long array, the purpose of which is unknown, but it's not required for the chunk to be accepted. |
+ | |- | ||
+ | | Size | ||
+ | | VarInt | ||
+ | | Size of Data in bytes | ||
|- | |- | ||
− | | | + | | Data |
− | | | + | | Byte array |
− | | [ | + | | See [[Chunk Format#Data structure|data structure]] in Chunk Format |
|- | |- | ||
− | | | + | | Number of block entities |
− | | | + | | VarInt |
− | | | + | | Number of elements in the following array |
|- | |- | ||
− | | | + | | Block entities |
− | | | + | | Array of [[NBT|NBT Tag]] |
− | | | + | | All block entities in the chunk. Use the x, y, and z tags in the NBT to determine their positions. |
|} | |} | ||
− | + | Note that the Notchian client requires an [[#Update View Position|Update View Position]] packet when it crosses a chunk border, otherwise it'll only display render distance + 2 chunks around the chunk it spawned in. | |
+ | |||
+ | ==== Effect ==== | ||
+ | |||
+ | Sent when a client is to play a sound or particle effect. | ||
+ | |||
+ | By default, the Minecraft client adjusts the volume of sound effects based on distance. The final boolean field is used to disable this, and instead the effect is played from 2 blocks away in the correct direction. Currently this is only used for effect 1023 (wither spawn) and effect 1028 (enderdragon death); it is ignored on other effects. | ||
{| class="wikitable" | {| class="wikitable" | ||
− | ! ID | + | ! Packet ID |
− | ! | + | ! State |
+ | ! Bound To | ||
+ | ! Field Name | ||
+ | ! Field Type | ||
+ | ! Notes | ||
|- | |- | ||
− | | | + | |rowspan="4"| 0x22 |
− | | | + | |rowspan="4"| Play |
+ | |rowspan="4"| Client | ||
+ | | Effect ID | ||
+ | | Int | ||
+ | | The ID of the effect, see below | ||
|- | |- | ||
− | | | + | | Location |
− | | | + | | Position |
+ | | The location of the effect | ||
|- | |- | ||
− | | | + | | Data |
− | | | + | | Int |
+ | | Extra data for certain effects, see below | ||
|- | |- | ||
− | | | + | | Disable Relative Volume |
− | | | + | | Boolean |
− | | | + | | See above |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|} | |} | ||
− | + | Effect IDs: | |
− | |||
− | |||
− | |||
− | |||
{| class="wikitable" | {| class="wikitable" | ||
− | ! | + | ! ID |
− | ! | + | ! Name |
− | + | ! Data | |
− | |||
− | ! | ||
− | |||
|- | |- | ||
− | + | !colspan="3"| Sound | |
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | | | + | | 1000 |
− | | | + | | Dispenser dispenses |
− | | | + | | |
|- | |- | ||
− | | | + | | 1001 |
− | | | + | | Dispenser fails to dispense |
− | | | + | | |
|- | |- | ||
− | | | + | | 1002 |
− | | | + | | Dispenser shoots |
− | | | + | | |
|- | |- | ||
− | | | + | | 1003 |
− | | | + | | Ender eye launched |
− | | | + | | |
|- | |- | ||
− | | | + | | 1004 |
− | | | + | | Firework shot |
− | | | + | | |
|- | |- | ||
− | | | + | | 1005 |
− | | | + | | Iron door opened |
− | | | + | | |
|- | |- | ||
− | | | + | | 1006 |
− | | | + | | Wooden door opened |
− | | | + | | |
|- | |- | ||
− | | | + | | 1007 |
− | | | + | | Wooden trapdoor opened |
− | | | + | | |
|- | |- | ||
− | | | + | | 1008 |
− | | | + | | Fence gate opened |
− | | | + | | |
|- | |- | ||
− | | | + | | 1009 |
− | | | + | | Fire extinguished |
− | | | + | | |
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | + | | 1010 | |
− | + | | Play record | |
+ | | Special case, see below for more info | ||
|- | |- | ||
− | | | + | | 1011 |
− | | | + | | Iron door closed |
+ | | | ||
|- | |- | ||
− | | | + | | 1012 |
− | | | + | | Wooden door closed |
+ | | | ||
|- | |- | ||
− | | | + | | 1013 |
− | | | + | | Wooden trapdoor closed |
+ | | | ||
|- | |- | ||
− | | | + | | 1014 |
− | | | + | | Fence gate closed |
+ | | | ||
|- | |- | ||
− | | | + | | 1015 |
− | | | + | | Ghast warns |
+ | | | ||
|- | |- | ||
− | | | + | | 1016 |
− | | | + | | Ghast shoots |
+ | | | ||
|- | |- | ||
− | | | + | | 1017 |
− | | | + | | Enderdragon shoots |
+ | | | ||
|- | |- | ||
− | | | + | | 1018 |
− | | | + | | Blaze shoots |
+ | | | ||
|- | |- | ||
− | | | + | | 1019 |
− | | | + | | Zombie attacks wood door |
+ | | | ||
|- | |- | ||
− | | | + | | 1020 |
− | | | + | | Zombie attacks iron door |
+ | | | ||
|- | |- | ||
− | | | + | | 1021 |
− | | | + | | Zombie breaks wood door |
+ | | | ||
|- | |- | ||
− | | | + | | 1022 |
− | | | + | | Wither breaks block |
+ | | | ||
|- | |- | ||
− | | | + | | 1023 |
− | | | + | | Wither spawned |
+ | | | ||
|- | |- | ||
− | | | + | | 1024 |
− | | | + | | Wither shoots |
+ | | | ||
|- | |- | ||
− | | | + | | 1025 |
− | | | + | | Bat takes off |
+ | | | ||
|- | |- | ||
− | | | + | | 1026 |
− | | | + | | Zombie infects |
+ | | | ||
|- | |- | ||
− | | | + | | 1027 |
− | | | + | | Zombie villager converted |
+ | | | ||
|- | |- | ||
− | | | + | | 1028 |
− | | | + | | Ender dragon death |
+ | | | ||
|- | |- | ||
− | | | + | | 1029 |
− | | | + | | Anvil destroyed |
+ | | | ||
|- | |- | ||
− | | | + | | 1030 |
− | | | + | | Anvil used |
+ | | | ||
|- | |- | ||
− | | | + | | 1031 |
− | | | + | | Anvil landed |
+ | | | ||
|- | |- | ||
− | | | + | | 1032 |
− | | | + | | Portal travel |
+ | | | ||
|- | |- | ||
− | | | + | | 1033 |
− | | | + | | Chorus flower grown |
+ | | | ||
|- | |- | ||
− | | | + | | 1034 |
− | | | + | | Chorus flower died |
+ | | | ||
|- | |- | ||
− | | | + | | 1035 |
− | | | + | | Brewing stand brewed |
+ | | | ||
|- | |- | ||
− | | | + | | 1036 |
− | | | + | | Iron trapdoor opened |
+ | | | ||
|- | |- | ||
− | | | + | | 1037 |
− | | | + | | Iron trapdoor closed |
+ | | | ||
|- | |- | ||
− | | | + | !colspan="3"| Particle |
− | |||
|- | |- | ||
− | | | + | | 2000 |
− | | | + | | Spawns 10 smoke particles, e.g. from a fire |
+ | | Direction, see below | ||
|- | |- | ||
− | | | + | | 2001 |
− | | | + | | Block break + block break sound |
+ | | Block state, as an index into the global palette | ||
|- | |- | ||
− | | | + | | 2002 |
− | | | + | | Splash potion. Particle effect + glass break sound. |
+ | | [http://minecraft.gamepedia.com/Data_values#Potions Potion ID] | ||
|- | |- | ||
− | | | + | | 2003 |
− | | | + | | Eye of Ender entity break animation — particles and sound |
+ | | | ||
|- | |- | ||
− | | | + | | 2004 |
− | | | + | | Mob spawn particle effect: smoke + flames |
+ | | | ||
|- | |- | ||
− | | | + | | 2005 |
− | | | + | | Bonemeal particles |
+ | | How many particles to spawn (if set to 0, 15 are spawned) | ||
|- | |- | ||
− | | | + | | 2006 |
− | | | + | | Dragon breath |
+ | | | ||
|- | |- | ||
− | | | + | | 2007 |
− | | | + | | Instant splash potion |
+ | | [http://minecraft.gamepedia.com/Data_values#Potions Potion ID] | ||
|- | |- | ||
− | | | + | | 3000 |
− | | | + | | End gateway spawn |
+ | | | ||
|- | |- | ||
− | | | + | | 3001 |
− | | | + | | Enderdragon growl |
+ | | | ||
+ | |} | ||
+ | |||
+ | Smoke directions: | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! ID | ||
+ | ! Direction | ||
|- | |- | ||
− | | | + | | 0 |
− | | | + | | South-East |
|- | |- | ||
− | | | + | | 1 |
− | | | + | | South |
|- | |- | ||
− | | | + | | 2 |
− | | | + | | South-West |
|- | |- | ||
− | | | + | | 3 |
− | | | + | | East |
|- | |- | ||
− | | | + | | 4 |
− | | | + | | (Up or middle ?) |
|- | |- | ||
− | | | + | | 5 |
− | | | + | | West |
|- | |- | ||
− | | | + | | 6 |
− | | | + | | North-East |
|- | |- | ||
− | | | + | | 7 |
− | | | + | | North |
|- | |- | ||
− | | | + | | 8 |
− | + | | North-West | |
− | |- | ||
− | |||
− | |||
− | |||
− | |||
− | |||
|} | |} | ||
− | ==== | + | Play record: This is actually a special case within this packet. You can start/stop a record at a specific location. Use a valid {{Minecraft Wiki|Music Discs|Record ID}} to start a record (or overwrite a currently playing one), any other value will stop the record. See [[Data Generators]] for information on item IDs. |
+ | |||
+ | ==== Particle ==== | ||
− | + | Displays the named particle | |
{| class="wikitable" | {| class="wikitable" | ||
Line 2,223: | Line 2,508: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan=" | + | |rowspan="11"| 0x23 |
− | |rowspan=" | + | |rowspan="11"| Play |
− | |rowspan=" | + | |rowspan="11"| Client |
− | | | + | | Particle ID |
| Int | | Int | ||
− | | The | + | | The particle ID listed in [[#Particle|the particle data type]]. |
+ | |- | ||
+ | | Long Distance | ||
+ | | Boolean | ||
+ | | If true, particle distance increases from 256 to 65536 | ||
+ | |- | ||
+ | | X | ||
+ | | Float | ||
+ | | X position of the particle | ||
+ | |- | ||
+ | | Y | ||
+ | | Float | ||
+ | | Y position of the particle | ||
+ | |- | ||
+ | | Z | ||
+ | | Float | ||
+ | | Z position of the particle | ||
|- | |- | ||
− | | | + | | Offset X |
− | | | + | | Float |
− | | | + | | This is added to the X position after being multiplied by random.nextGaussian() |
|- | |- | ||
− | | | + | | Offset Y |
− | | | + | | Float |
− | | | + | | This is added to the Y position after being multiplied by random.nextGaussian() |
|- | |- | ||
− | | | + | | Offset Z |
− | | | + | | Float |
− | | | + | | This is added to the Z position after being multiplied by random.nextGaussian() |
|- | |- | ||
− | | | + | | Particle Data |
− | | | + | | Float |
− | | | + | | The data of each particle |
|- | |- | ||
− | | | + | | Particle Count |
− | | | + | | Int |
− | | | + | | The number of particles to create |
|- | |- | ||
− | | | + | | Data |
− | | | + | | Varies |
− | | | + | | The variable data listed in [[#Particle|the particle data type]]. |
|} | |} | ||
− | ==== | + | ==== Update Light ==== |
− | Updates a | + | Updates light levels for a chunk. |
{| class="wikitable" | {| class="wikitable" | ||
Line 2,267: | Line 2,568: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan=" | + | |rowspan="10"| 0x24 |
− | |rowspan=" | + | |rowspan="10"| Play |
− | |rowspan=" | + | |rowspan="10"| Client |
− | |colspan="2"| | + | |colspan="2"| Chunk X |
|colspan="2"| VarInt | |colspan="2"| VarInt | ||
− | | | + | | Chunk coordinate (block coordinate divided by 16, rounded down) |
|- | |- | ||
− | |colspan="2"| | + | |colspan="2"| Chunk Z |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|colspan="2"| VarInt | |colspan="2"| VarInt | ||
− | | | + | | Chunk coordinate (block coordinate divided by 16, rounded down) |
|- | |- | ||
− | | | + | |colspan="2"| Sky Light Mask |
− | | | + | |colspan="2"| VarInt |
− | + | | Mask containing 18 bits, with the lowest bit corresponding to chunk section -1 (in the void, y=-16 to y=-1) and the highest bit for chunk section 16 (above the world, y=256 to y=271) | |
− | | | ||
− | |||
|- | |- | ||
− | | | + | |colspan="2"| Block Light Mask |
− | | | + | |colspan="2"| VarInt |
− | | | + | | Mask containing 18 bits, with the same order as sky light |
|- | |- | ||
− | + | |colspan="2"| Empty Sky Light Mask | |
− | + | |colspan="2"| VarInt | |
− | + | | Mask containing 18 bits, which indicates sections that have 0 for all their sky light values. If a section is set in both this mask and the main sky light mask, it is ignored for this mask and it is included in the sky light arrays (the notchian server does not create such masks). If it is only set in this mask, it is not included in the sky light arrays. | |
− | |||
− | |colspan="2"| | ||
− | |colspan="2"| | ||
− | | | ||
|- | |- | ||
− | |colspan="2"| | + | |colspan="2"| Empty Block Light Mask |
− | |colspan="2"| | + | |colspan="2"| VarInt |
− | | | + | | Mask containing 18 bits, which indicates sections that have 0 for all their block light values. If a section is set in both this mask and the main block light mask, it is ignored for this mask and it is included in the block light arrays (the notchian server does not create such masks). If it is only set in this mask, it is not included in the block light arrays. |
|- | |- | ||
− | | | + | |rowspan="2"| Sky Light arrays |
− | | | + | | Length |
− | | | + | |rowspan="2"| Array |
+ | | VarInt | ||
+ | | Length of the following array in bytes (always 2048) | ||
|- | |- | ||
− | | | + | | Sky Light array |
− | | | + | | Array of 2048 bytes |
− | | | + | | There is 1 array for each bit set to true in the sky light mask, starting with the lowest value. Half a byte per light value. |
|- | |- | ||
− | | | + | |rowspan="2"| Block Light arrays |
− | | | + | | Length |
− | | | + | |rowspan="2"| Array |
+ | | VarInt | ||
+ | | Length of the following array in bytes (always 2048) | ||
|- | |- | ||
− | | | + | | Block Light array |
− | | | + | | Array of 2048 bytes |
− | | | + | | There is 1 array for each bit set to true in the block light mask, starting with the lowest value. Half a byte per light value. |
|} | |} | ||
− | + | Individual block or sky light arrays are is given for each block with increasing x coordinates, within rows of increasing z coordinates, within layers of increasing y coordinates. Even-indexed items (those with an even x coordinate, starting at 0) are packed into the low bits, odd-indexed into the high bits. | |
− | + | ==== Join Game ==== | |
− | + | See [[Protocol Encryption]] for information on logging in. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
{| class="wikitable" | {| class="wikitable" | ||
Line 2,382: | Line 2,630: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan=" | + | |rowspan="7"| 0x25 |
− | |rowspan=" | + | |rowspan="7"| Play |
− | |rowspan=" | + | |rowspan="7"| Client |
| Entity ID | | Entity ID | ||
+ | | Int | ||
+ | | The player's Entity ID (EID) | ||
+ | |- | ||
+ | | Gamemode | ||
+ | | Unsigned Byte | ||
+ | | 0: Survival, 1: Creative, 2: Adventure, 3: Spectator. Bit 3 (0x8) is the hardcore flag. | ||
+ | |- | ||
+ | | Dimension | ||
+ | | Int Enum | ||
+ | | -1: Nether, 0: Overworld, 1: End; also, note that this is not a VarInt but instead a regular int. | ||
+ | |- | ||
+ | | Max Players | ||
+ | | Unsigned Byte | ||
+ | | Was once used by the client to draw the player list, but now is ignored | ||
+ | |- | ||
+ | | Level Type | ||
+ | | String Enum (16) | ||
+ | | default, flat, largeBiomes, amplified, customized, buffet, default_1_1 | ||
+ | |- | ||
+ | | View Distance | ||
| VarInt | | VarInt | ||
− | | | + | | Render distance (2-32) |
+ | |- | ||
+ | | Reduced Debug Info | ||
+ | | Boolean | ||
+ | | If true, a Notchian client shows reduced information on the {{Minecraft Wiki|debug screen}}. For servers in development, this should almost always be false. | ||
|} | |} | ||
− | ==== | + | ==== Map Data ==== |
− | + | Updates a rectangular area on a {{Minecraft Wiki|map}} item. | |
− | |||
− | |||
{| class="wikitable" | {| class="wikitable" | ||
Line 2,400: | Line 2,670: | ||
! State | ! State | ||
! Bound To | ! Bound To | ||
− | ! Field Name | + | !colspan="2"| Field Name |
− | ! Field Type | + | !colspan="2"| Field Type |
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan=" | + | |rowspan="17"| 0x26 |
− | |rowspan=" | + | |rowspan="17"| Play |
− | |rowspan=" | + | |rowspan="17"| Client |
− | | | + | |colspan="2"| Map ID |
− | | VarInt | + | |colspan="2"| VarInt |
− | | | + | | Map ID of the map being modified |
|- | |- | ||
− | | | + | |colspan="2"| Scale |
− | | | + | |colspan="2"| Byte |
− | | | + | | From 0 for a fully zoomed-in map (1 block per pixel) to 4 for a fully zoomed-out map (16 blocks per pixel) |
− | |- | + | |- |
− | | | + | |colspan="2"| Tracking Position |
− | | | + | |colspan="2"| Boolean |
− | | | + | | Specifies whether player and item frame icons are shown |
|- | |- | ||
− | | | + | |colspan="2"| Locked |
− | | | + | |colspan="2"| Boolean |
− | | | + | | True if the map has been locked in a cartography table |
+ | |- | ||
+ | |colspan="2"| Icon Count | ||
+ | |colspan="2"| VarInt | ||
+ | | Number of elements in the following array | ||
|- | |- | ||
− | | | + | |rowspan="6"| Icon |
− | + | | Type | |
− | | | + | |rowspan="6"| Array |
− | | | + | | VarInt enum |
− | + | | See below | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | | | + | | X |
− | + | | Byte | |
− | + | | Map coordinates: -128 for furthest left, +127 for furthest right | |
− | |||
− | | | ||
− | | | ||
|- | |- | ||
− | | | + | | Z |
− | | | + | | Byte |
− | | | + | | Map coordinates: -128 for highest, +127 for lowest |
|- | |- | ||
− | | | + | | Direction |
− | | | + | | Byte |
− | | | + | | 0-15 |
|- | |- | ||
− | | | + | | Has Display Name |
− | | | + | | Boolean |
− | | | + | | |
+ | |- | ||
+ | | Display Name | ||
+ | | Optional [[Chat]] | ||
+ | | Only present if previous Boolean is true | ||
+ | |- | ||
+ | |colspan="2"| Columns | ||
+ | |colspan="2"| Unsigned Byte | ||
+ | | Number of columns updated | ||
+ | |- | ||
+ | |colspan="2"| Rows | ||
+ | |colspan="2"| Optional Byte | ||
+ | | Only if Columns is more than 0; number of rows updated | ||
+ | |- | ||
+ | |colspan="2"| X | ||
+ | |colspan="2"| Optional Byte | ||
+ | | Only if Columns is more than 0; x offset of the westernmost column | ||
|- | |- | ||
− | | | + | |colspan="2"| Z |
− | | | + | |colspan="2"| Optional Byte |
− | | | + | | Only if Columns is more than 0; z offset of the northernmost row |
|- | |- | ||
− | | | + | |colspan="2"| Length |
− | | | + | |colspan="2"| Optional VarInt |
− | | | + | | Only if Columns is more than 0; length of the following array |
|- | |- | ||
− | | | + | |colspan="2"| Data |
− | | | + | |colspan="2"| Optional Array of Unsigned Byte |
− | | | + | | Only if Columns is more than 0; see {{Minecraft Wiki|Map item format}} |
|} | |} | ||
− | + | For icons, a direction of 0 is a vertical icon and increments by 22.5° (360/16). | |
− | + | Types are based off of rows and columns in <code>map_icons.png</code>: | |
{| class="wikitable" | {| class="wikitable" | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | + | ! Icon type | |
− | + | ! Result | |
− | + | |- | |
− | | | + | | 0 |
− | | | + | | White arrow (players) |
− | | | ||
|- | |- | ||
− | | | + | | 1 |
− | | | + | | Green arrow (item frames) |
− | |||
|- | |- | ||
− | | | + | | 2 |
− | | | + | | Red arrow |
− | |||
|- | |- | ||
− | | | + | | 3 |
− | | | + | | Blue arrow |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | | | + | | 4 |
− | + | | White cross | |
− | |||
− | |||
− | |||
− | | | ||
|- | |- | ||
− | | | + | | 5 |
− | | | + | | Red pointer |
− | |||
|- | |- | ||
− | | | + | | 6 |
− | | | + | | White circle (off-map players) |
− | |||
|- | |- | ||
− | | | + | | 7 |
− | | | + | | Small white circle (far-off-map players) |
− | | | + | |- |
+ | | 8 | ||
+ | | Mansion | ||
+ | |- | ||
+ | | 9 | ||
+ | | Temple | ||
+ | |- | ||
+ | | 10 | ||
+ | | White Banner | ||
+ | |- | ||
+ | | 11 | ||
+ | | Orange Banner | ||
+ | |- | ||
+ | | 12 | ||
+ | | Magenta Banner | ||
+ | |- | ||
+ | | 13 | ||
+ | | Light Blue Banner | ||
+ | |- | ||
+ | | 14 | ||
+ | | Yellow Banner | ||
+ | |- | ||
+ | | 15 | ||
+ | | Lime Banner | ||
+ | |- | ||
+ | | 16 | ||
+ | | Pink Banner | ||
+ | |- | ||
+ | | 17 | ||
+ | | Gray Banner | ||
+ | |- | ||
+ | | 18 | ||
+ | | Light Gray Banner | ||
+ | |- | ||
+ | | 19 | ||
+ | | Cyan Banner | ||
+ | |- | ||
+ | | 20 | ||
+ | | Purple Banner | ||
+ | |- | ||
+ | | 21 | ||
+ | | Blue Banner | ||
+ | |- | ||
+ | | 22 | ||
+ | | Brown Banner | ||
+ | |- | ||
+ | | 23 | ||
+ | | Green Banner | ||
+ | |- | ||
+ | | 24 | ||
+ | | Red Banner | ||
+ | |- | ||
+ | | 25 | ||
+ | | Black Banner | ||
|- | |- | ||
− | | | + | | 26 |
− | | | + | | Treasure marker |
− | |||
|} | |} | ||
− | ==== | + | ==== Trade List ==== |
− | + | The list of trades a villager NPC is offering. | |
{| class="wikitable" | {| class="wikitable" | ||
Line 2,548: | Line 2,847: | ||
! State | ! State | ||
! Bound To | ! Bound To | ||
− | ! Field Name | + | !colspan="2"| Field Name |
− | ! Field Type | + | !colspan="2"| Field Type |
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan=" | + | |rowspan="18"| 0x27 |
− | |rowspan=" | + | |rowspan="18"| Play |
− | |rowspan="1"| | + | |rowspan="18"| Client |
− | | | + | |- |
− | | | + | | colspan="2" | Window ID |
− | | | + | | colspan="2" | VarInt |
+ | | The ID of the window that is open; this is an int rather than a byte. | ||
+ | |- | ||
+ | | colspan="2" | Size | ||
+ | | colspan="2" | Byte | ||
+ | | The number of trades in the following array | ||
+ | |- | ||
+ | | rowspan="11" | Trades | ||
+ | | Input item 1 | ||
+ | | rowspan="11" | Array | ||
+ | | [[Slot]] | ||
+ | | The first item the villager is buying | ||
+ | |- | ||
+ | | Output item | ||
+ | | [[Slot]] | ||
+ | | The item the villager is selling | ||
+ | |- | ||
+ | | Has second item | ||
+ | | Boolean | ||
+ | | Whether there is a second item | ||
+ | |- | ||
+ | | Input item 2 | ||
+ | | Optional [[Slot]] | ||
+ | | The second item the villager is buying; only present if they have a second item. | ||
+ | |- | ||
+ | | Trade disabled | ||
+ | | Boolean | ||
+ | | True if the trade is disabled; false if the trade is enabled. | ||
+ | |- | ||
+ | | Number of trade uses | ||
+ | | Integer | ||
+ | | Number of times the trade has been used so far | ||
+ | |- | ||
+ | | Maximum number of trade uses | ||
+ | | Integer | ||
+ | | Number of times this trade can be used | ||
+ | |- | ||
+ | | XP | ||
+ | | Integer | ||
+ | | | ||
+ | |- | ||
+ | | Special Price | ||
+ | | Integer | ||
+ | | | ||
+ | |- | ||
+ | | Price Multiplier | ||
+ | | Float | ||
+ | | | ||
+ | |- | ||
+ | | Demand | ||
+ | | Integer | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| Villager level | ||
+ | |colspan="2"| VarInt | ||
+ | | Appears on the trade GUI; meaning comes from the translation key <code>merchant.level.</code> + level. | ||
+ | 1: Novice, 2: Apprentice, 3: Journeyman, 4: Expert, 5: Master | ||
+ | |- | ||
+ | |colspan="2"| Experience | ||
+ | |colspan="2"| VarInt | ||
+ | | Total experience for this villager (always 0 for the wandering trader) | ||
+ | |- | ||
+ | |colspan="2"| Is regular villager | ||
+ | |colspan="2"| Boolean | ||
+ | | True if this is a regular villager; false for the wandering trader. When false, hides the villager level and some other GUI elements. | ||
+ | |- | ||
+ | |colspan="2"| Can restock | ||
+ | |colspan="2"| Boolean | ||
+ | | True for regular villagers and false for the wandering trader. If true, the "Villagers restock up to two times per day." message is displayed when hovering over disabled trades. | ||
|} | |} | ||
− | + | [[File:1.14-merchant-slots.png|thumb|The merchant UI, for reference]] | |
+ | {{-}} | ||
− | + | ==== Entity Relative Move ==== | |
− | {| class="wikitable" | + | This packet is sent by the server when an entity moves less then 8 blocks; if an entity moves more than 8 blocks [[#Entity Teleport|Entity Teleport]] should be sent instead. |
+ | |||
+ | This packet allows at most 8 blocks movement in any direction, because short range is from -32768 to 32767. And <code>32768 / (128 * 32)</code> = 8. | ||
+ | |||
+ | {| class="wikitable" | ||
! Packet ID | ! Packet ID | ||
! State | ! State | ||
Line 2,572: | Line 2,944: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan=" | + | |rowspan="5"| 0x28 |
− | |rowspan=" | + | |rowspan="5"| Play |
− | |rowspan=" | + | |rowspan="5"| Client |
− | | | + | | Entity ID |
− | | | + | | VarInt |
− | | | + | | |
+ | |- | ||
+ | | Delta X | ||
+ | | Short | ||
+ | | Change in X position as <code>(currentX * 32 - prevX * 32) * 128</code> | ||
+ | |- | ||
+ | | Delta Y | ||
+ | | Short | ||
+ | | Change in Y position as <code>(currentY * 32 - prevY * 32) * 128</code> | ||
+ | |- | ||
+ | | Delta Z | ||
+ | | Short | ||
+ | | Change in Z position as <code>(currentZ * 32 - prevZ * 32) * 128</code> | ||
|- | |- | ||
− | | | + | | On Ground |
− | | | + | | Boolean |
− | | | + | | |
|} | |} | ||
− | ==== | + | ==== Entity Look And Relative Move ==== |
− | + | This packet is sent by the server when an entity rotates and moves. Since a short range is limited from -32768 to 32767, and movement is offset of fixed-point numbers, this packet allows at most 8 blocks movement in any direction. (<code>-32768 / (32 * 128) == -8</code>) | |
{| class="wikitable" | {| class="wikitable" | ||
Line 2,596: | Line 2,980: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan=" | + | |rowspan="7"| 0x29 |
− | |rowspan=" | + | |rowspan="7"| Play |
− | |rowspan=" | + | |rowspan="7"| Client |
− | | | + | | Entity ID |
− | | | + | | VarInt |
− | |||
− | |||
− | |||
− | |||
| | | | ||
|- | |- | ||
− | | | + | | Delta X |
− | | | + | | Short |
− | | | + | | Change in X position as <code>(currentX * 32 - prevX * 32) * 128</code> |
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | + | | Delta Y | |
− | + | | Short | |
+ | | Change in Y position as <code>(currentY * 32 - prevY * 32) * 128</code> | ||
|- | |- | ||
− | | | + | | Delta Z |
− | | | + | | Short |
+ | | Change in Z position as <code>(currentZ * 32 - prevZ * 32) * 128</code> | ||
|- | |- | ||
− | | | + | | Yaw |
− | | | + | | Angle |
+ | | New angle, not a delta | ||
|- | |- | ||
− | | | + | | Pitch |
− | | | + | | Angle |
+ | | New angle, not a delta | ||
|- | |- | ||
− | | | + | | On Ground |
− | | | + | | Boolean |
+ | | | ||
|} | |} | ||
− | ==== | + | ==== Entity Look ==== |
+ | |||
+ | This packet is sent by the server when an entity rotates. | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 2,638: | Line 3,020: | ||
! State | ! State | ||
! Bound To | ! Bound To | ||
− | ! | + | ! Field Name |
! Field Type | ! Field Type | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan=" | + | |rowspan="4"| 0x2A |
− | |rowspan=" | + | |rowspan="4"| Play |
− | |rowspan=" | + | |rowspan="4"| Client |
− | | | + | | Entity ID |
− | | VarInt | + | | VarInt |
− | | | + | | |
|- | |- | ||
− | + | | Yaw | |
− | + | | Angle | |
− | + | | New angle, not a delta | |
− | |||
|- | |- | ||
− | | | + | | Pitch |
− | | | + | | Angle |
− | + | | New angle, not a delta | |
− | | | ||
|- | |- | ||
− | | | + | | On Ground |
− | + | | Boolean | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | | | ||
| | | | ||
|} | |} | ||
− | ==== | + | ==== Entity ==== |
− | + | This packet may be used to initialize an entity. | |
+ | |||
+ | For player entities, either this packet or any move/look packet is sent every game tick. So the meaning of this packet is basically that the entity did not move/look since the last such packet. | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 2,690: | Line 3,054: | ||
! State | ! State | ||
! Bound To | ! Bound To | ||
− | ! | + | ! Field Name |
− | ! | + | ! Field Type |
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan=" | + | |rowspan="1"| 0x2B |
− | |rowspan=" | + | |rowspan="1"| Play |
− | |rowspan=" | + | |rowspan="1"| Client |
− | | | + | | Entity ID |
− | | | + | | VarInt |
− | + | | | |
+ | |} | ||
+ | |||
+ | ==== Vehicle Move (clientbound) ==== | ||
+ | |||
+ | Note that all fields use absolute positioning and do not allow for relative positioning. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! Packet ID | ||
+ | ! State | ||
+ | ! Bound To | ||
+ | ! Field Name | ||
+ | ! Field Type | ||
+ | ! Notes | ||
|- | |- | ||
− | | | + | |rowspan="5"| 0x2C |
− | | | + | |rowspan="5"| Play |
− | | | + | |rowspan="5"| Client |
+ | | X | ||
+ | | Double | ||
+ | | Absolute position (X coordinate) | ||
|- | |- | ||
− | | | + | | Y |
− | + | | Double | |
− | | | + | | Absolute position (Y coordinate) |
− | |||
− | | | ||
|- | |- | ||
− | + | | Z | |
− | + | | Double | |
− | + | | Absolute position (Z coordinate) | |
− | |||
|- | |- | ||
− | | | + | | Yaw |
− | + | | Float | |
− | | | + | | Absolute rotation on the vertical axis, in degrees |
− | | | ||
|- | |- | ||
− | | | + | | Pitch |
− | | | + | | Float |
− | + | | Absolute rotation on the horizontal axis, in degrees | |
+ | |} | ||
+ | |||
+ | ==== Open Book ==== | ||
+ | |||
+ | Sent when a player right clicks with a signed book. This tells the client to open the book GUI. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! Packet ID | ||
+ | ! State | ||
+ | ! Bound To | ||
+ | ! Field Name | ||
+ | ! Field Type | ||
+ | ! Notes | ||
|- | |- | ||
− | |rowspan=" | + | |rowspan="1"| 0x2D |
− | | | + | |rowspan="1"| Play |
− | |rowspan=" | + | |rowspan="1"| Client |
− | | | + | | Hand |
− | | | + | | VarInt enum |
+ | | 0: Main hand, 1: Off hand | ||
+ | |} | ||
+ | |||
+ | ==== Open Window ==== | ||
+ | |||
+ | This is sent to the client when it should open an inventory, such as a chest, workbench, or furnace. This message is not sent anywhere for clients opening their own inventory. For horses, use [[#Open Horse Window|Open Horse Window]]. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! Packet ID | ||
+ | ! State | ||
+ | ! Bound To | ||
+ | ! Field Name | ||
+ | ! Field Type | ||
+ | ! Notes | ||
|- | |- | ||
− | | | + | |rowspan="3"| 0x2E |
− | | | + | |rowspan="3"| Play |
− | | | + | |rowspan="3"| Client |
− | + | | Window ID | |
− | | | + | | VarInt |
− | | | + | | A unique id number for the window to be displayed. Notchian server implementation is a counter, starting at 1. |
− | | | ||
|- | |- | ||
− | | | + | | Window Type |
− | | | + | | VarInt |
− | | | + | | The window type to use for display. Contained in the <code>minecraft:menu</code> regisry; see [[Inventory]] for the different values. |
|- | |- | ||
− | | | + | | Window Title |
− | + | | [[Chat]] | |
− | + | | The title of the window | |
+ | |} | ||
+ | |||
+ | ==== Open Sign Editor ==== | ||
+ | |||
+ | Sent when the client has placed a sign and is allowed to send [[#Update Sign|Update Sign]]. There must already be a sign at the given location (which the client does not do automatically) - send a [[#Block Change|Block Change]] first. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! Packet ID | ||
+ | ! State | ||
+ | ! Bound To | ||
+ | ! Field Name | ||
+ | ! Field Type | ||
+ | ! Notes | ||
|- | |- | ||
− | | | + | |rowspan="1"| 0x2F |
− | | | + | |rowspan="1"| Play |
− | | | + | |rowspan="1"| Client |
− | + | | Location | |
− | + | | Position | |
− | | | ||
| | | | ||
+ | |} | ||
+ | |||
+ | ==== Craft Recipe Response ==== | ||
+ | |||
+ | Response to the serverbound packet ([[#Craft Recipe Request|Craft Recipe Request]]), with the same recipe ID. Appears to be used to notify the UI. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! Packet ID | ||
+ | ! State | ||
+ | ! Bound To | ||
+ | ! Field Name | ||
+ | ! Field Type | ||
+ | ! Notes | ||
|- | |- | ||
− | | | + | |rowspan="2"| 0x30 |
− | | | + | |rowspan="2"| Play |
− | | | + | |rowspan="2"| Client |
+ | | Window ID | ||
+ | | Byte | ||
+ | | | ||
|- | |- | ||
− | | | + | | Recipe |
− | | | + | | Identifier |
− | + | | A recipe ID | |
− | + | |} | |
− | + | ||
− | + | ==== Player Abilities (clientbound) ==== | |
− | + | ||
− | + | The latter 2 floats are used to indicate the field of view and flying speed respectively, while the first byte is used to determine the value of 4 booleans. | |
− | + | ||
+ | {| class="wikitable" | ||
+ | ! Packet ID | ||
+ | ! State | ||
+ | ! Bound To | ||
+ | ! Field Name | ||
+ | ! Field Type | ||
+ | ! Notes | ||
|- | |- | ||
− | |rowspan=" | + | |rowspan="3"| 0x31 |
− | | | + | |rowspan="3"| Play |
− | | | + | |rowspan="3"| Client |
− | | | + | | Flags |
+ | | Byte | ||
+ | | Bit field, see below | ||
|- | |- | ||
− | | | + | | Flying Speed |
− | | | + | | Float |
− | | | + | | 0.05 by default |
|- | |- | ||
− | | | + | | Field of View Modifier |
− | | | + | | Float |
− | | | + | | Modifies the field of view, like a speed potion. A Notchian server will use the same value as the movement speed sent in the [[Protocol#Entity_Properties|Entity Properties]] packet, which defaults to 0.1 for players. |
− | |||
|} | |} | ||
− | + | About the flags: | |
− | + | {| class="wikitable" | |
− | + | |- | |
− | + | ! Field | |
− | + | ! Bit | |
− | + | |- | |
− | + | | Invulnerable | |
− | + | | 0x01 | |
+ | |- | ||
+ | | Flying | ||
+ | | 0x02 | ||
+ | |- | ||
+ | | Allow Flying | ||
+ | | 0x04 | ||
+ | |- | ||
+ | | Creative Mode (Instant Break) | ||
+ | | 0x08 | ||
+ | |} | ||
− | ==== | + | ==== Combat Event ==== |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
{| class="wikitable" | {| class="wikitable" | ||
Line 2,810: | Line 3,248: | ||
! State | ! State | ||
! Bound To | ! Bound To | ||
− | ! Field Name | + | !colspan="2"| Field Name |
! Field Type | ! Field Type | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan=" | + | |rowspan="8"| 0x32 |
− | |rowspan=" | + | |rowspan="8"| Play |
− | |rowspan=" | + | |rowspan="8"| Client |
− | | | + | |colspan="2"| Event |
− | | | + | | VarInt Enum |
− | | | + | | Determines the layout of the remaining packet |
|- | |- | ||
− | | | + | ! Event |
− | | | + | ! Field Name |
− | | | + | ! |
+ | ! | ||
+ | |- | ||
+ | | 0: enter combat | ||
+ | | ''no fields'' | ||
+ | | ''no fields'' | ||
+ | | | ||
|- | |- | ||
− | | | + | |rowspan="2"| 1: end combat |
− | | | + | | Duration |
− | | | + | | VarInt |
+ | | | ||
|- | |- | ||
− | | | + | | Entity ID |
− | | | + | | Int |
− | | | + | | |
|- | |- | ||
− | | | + | |rowspan="3"| 2: entity dead |
− | | | + | | Player ID |
− | | | + | | VarInt |
+ | | | ||
|- | |- | ||
− | | | + | | Entity ID |
− | | | + | | Int |
− | | | + | | |
|- | |- | ||
− | | | + | | Message |
− | | | + | | [[Chat]] |
− | + | | | |
|} | |} | ||
− | + | ==== Player Info ==== | |
− | + | Sent by the server to update the user list (<tab> in the client). | |
{| class="wikitable" | {| class="wikitable" | ||
+ | ! Packet ID | ||
+ | ! State | ||
+ | ! Bound To | ||
+ | !colspan="4"| Field Name | ||
+ | !colspan="3"| Field Type | ||
+ | ! Notes | ||
|- | |- | ||
− | + | |rowspan="19"| 0x33 | |
− | + | |rowspan="19"| Play | |
− | | | + | |rowspan="19"| Client |
− | | | + | |colspan="4"| Action |
− | | | + | |colspan="3"| VarInt |
+ | | Determines the rest of the Player format after the UUID | ||
|- | |- | ||
− | | | + | |colspan="4"| Number Of Players |
− | | | + | |colspan="3"| VarInt |
+ | | Number of elements in the following array | ||
|- | |- | ||
− | | | + | |rowspan="17"| Player |
− | | | + | |colspan="3"| UUID |
+ | |rowspan="17"| Array | ||
+ | |colspan="2"| UUID | ||
+ | | | ||
|- | |- | ||
− | | | + | ! Action |
− | | | + | !colspan="2"| Field Name |
+ | !colspan="2"| | ||
+ | ! | ||
|- | |- | ||
− | | | + | |rowspan="10"| 0: add player |
− | + | |colspan="2"| Name | |
− | | | + | |colspan="2"| String (16) |
− | + | | | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | | | + | |colspan="2"| Number Of Properties |
− | | | + | |colspan="2"| VarInt |
− | + | | Number of elements in the following array | |
− | |||
− | |||
− | | | ||
|- | |- | ||
− | | | + | |rowspan="4"| Property |
− | + | | Name | |
− | | | + | |rowspan="4"| Array |
− | | | + | | String (32767) |
− | + | | | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | | | + | | Value |
− | | | + | | String (32767) |
− | | | + | | |
+ | |- | ||
+ | | Is Signed | ||
+ | | Boolean | ||
+ | | | ||
|- | |- | ||
− | | | + | | Signature |
− | | | + | | Optional String (32767) |
− | | | + | | Only if Is Signed is true |
|- | |- | ||
− | | | + | |colspan="2"| Gamemode |
− | | | + | |colspan="2"| VarInt |
− | | | + | | |
|- | |- | ||
− | | | + | |colspan="2"| Ping |
− | | | + | |colspan="2"| VarInt |
− | | | + | | Measured in milliseconds |
|- | |- | ||
− | | | + | |colspan="2"| Has Display Name |
− | | VarInt | + | |colspan="2"| Boolean |
− | | | + | | |
+ | |- | ||
+ | |colspan="2"| Display Name | ||
+ | |colspan="2"| Optional [[Chat]] | ||
+ | | Only if Has Display Name is true | ||
+ | |- | ||
+ | | 1: update gamemode | ||
+ | |colspan="2"| Gamemode | ||
+ | |colspan="2"| VarInt | ||
+ | | | ||
+ | |- | ||
+ | | 2: update latency | ||
+ | |colspan="2"| Ping | ||
+ | |colspan="2"| VarInt | ||
+ | | Measured in milliseconds | ||
|- | |- | ||
− | | | + | |rowspan="2"| 3: update display name |
− | | | + | |colspan="2"| Has Display Name |
− | | | + | |colspan="2"| Boolean |
+ | | | ||
|- | |- | ||
− | | | + | |colspan="2"| Display Name |
− | | Optional | + | |colspan="2"| Optional [[Chat]] |
− | | | + | | Only send if Has Display Name is true |
|- | |- | ||
− | | | + | | 4: remove player |
− | | | + | |colspan="2"| ''no fields'' |
− | | | + | |colspan="2"| ''no fields'' |
+ | | | ||
|} | |} | ||
− | |||
− | |||
− | |||
− | |||
− | + | The Property field looks as in the response of [[Mojang API#UUID -> Profile + Skin/Cape]], except of course using the protocol format instead of JSON. That is, each player will usually have one property with Name “textures” and Value being a base64-encoded JSON string as documented at [[Mojang API#UUID -> Profile + Skin/Cape]]. An empty properties array is also acceptable, and will cause clients to display the player with one of the two default skins depending on UUID. | |
− | |||
− | ==== | + | Ping values correspond with icons in the following way: |
− | + | * A ping that negative (i.e. not known to the server yet) will result in the no connection icon. | |
− | + | * A ping under 150 milliseconds will result in 5 bars | |
+ | * A ping under 300 milliseconds will result in 4 bars | ||
+ | * A ping under 600 milliseconds will result in 3 bars | ||
+ | * A ping under 1000 milliseconds (1 second) will result in 2 bars | ||
+ | * A ping greater than or equal to 1 second will result in 1 bar. | ||
+ | |||
+ | ==== Face Player ==== | ||
+ | |||
+ | Used to rotate the client player to face the given location or entity (for <code>/teleport [<targets>] <x> <y> <z> facing</code>). | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 2,963: | Line 3,416: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan=" | + | |rowspan="8"| 0x34 |
− | |rowspan=" | + | |rowspan="8"| Play |
− | |rowspan=" | + | |rowspan="8"| Client |
− | | | + | |- |
− | | VarInt | + | | Feet/eyes |
− | | | + | | VarInt enum |
+ | | Values are feet=0, eyes=1. If set to eyes, aims using the head position; otherwise aims using the feet position. | ||
+ | |- | ||
+ | | Target x | ||
+ | | Double | ||
+ | | x coordinate of the point to face towards | ||
+ | |- | ||
+ | | Target y | ||
+ | | Double | ||
+ | | y coordinate of the point to face towards | ||
+ | |- | ||
+ | | Target z | ||
+ | | Double | ||
+ | | z coordinate of the point to face towards | ||
+ | |- | ||
+ | | Is entity | ||
+ | | Boolean | ||
+ | | If true, additional information about an entity is provided. | ||
+ | |- | ||
+ | | Entity ID | ||
+ | | Optional VarInt | ||
+ | | Only if is entity is true — the entity to face towards | ||
|- | |- | ||
− | | Entity | + | | Entity feet/eyes |
− | | | + | | Optional VarInt enum |
− | | | + | | Whether to look at the entity's eyes or feet. Same values and meanings as before, just for the entity's head/feet. |
|} | |} | ||
− | ==== | + | If the entity given by entity ID cannot be found, this packet should be treated as if is entity was false. |
+ | |||
+ | ==== Player Position And Look (clientbound) ==== | ||
+ | |||
+ | Updates the player's position on the server. This packet will also close the “Downloading Terrain” screen when joining/respawning. | ||
+ | |||
+ | If the distance between the last known position of the player on the server and the new position set by this packet is greater than 100 meters, the client will be kicked for “You moved too quickly :( (Hacking?)”. | ||
+ | |||
+ | Also if the fixed-point number of X or Z is set greater than <code>3.2E7D</code> the client will be kicked for “Illegal position”. | ||
+ | |||
+ | Yaw is measured in degrees, and does not follow classical trigonometry rules. The unit circle of yaw on the XZ-plane starts at (0, 1) and turns counterclockwise, with 90 at (-1, 0), 180 at (0, -1) and 270 at (1, 0). Additionally, yaw is not clamped to between 0 and 360 degrees; any number is valid, including negative numbers and numbers greater than 360. | ||
+ | |||
+ | Pitch is measured in degrees, where 0 is looking straight ahead, -90 is looking straight up, and 90 is looking straight down. | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 2,985: | Line 3,471: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan=" | + | |rowspan="7"| 0x35 |
− | |rowspan=" | + | |rowspan="7"| Play |
− | |rowspan=" | + | |rowspan="7"| Client |
− | | | + | | X |
− | | | + | | Double |
− | | | + | | Absolute or relative position, depending on Flags |
+ | |- | ||
+ | | Y | ||
+ | | Double | ||
+ | | Absolute or relative position, depending on Flags | ||
+ | |- | ||
+ | | Z | ||
+ | | Double | ||
+ | | Absolute or relative position, depending on Flags | ||
+ | |- | ||
+ | | Yaw | ||
+ | | Float | ||
+ | | Absolute or relative rotation on the X axis, in degrees | ||
+ | |- | ||
+ | | Pitch | ||
+ | | Float | ||
+ | | Absolute or relative rotation on the Y axis, in degrees | ||
|- | |- | ||
− | | | + | | Flags |
| Byte | | Byte | ||
− | | | + | | Bit field, see below |
+ | |- | ||
+ | | Teleport ID | ||
+ | | VarInt | ||
+ | | Client should confirm this packet with [[#Teleport Confirm|Teleport Confirm]] containing the same Teleport ID | ||
|} | |} | ||
− | + | About the Flags field: | |
+ | |||
+ | <Dinnerbone> It's a bitfield, X/Y/Z/Y_ROT/X_ROT. If X is set, the x value is relative and not absolute. | ||
{| class="wikitable" | {| class="wikitable" | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | + | ! Field | |
− | + | ! Bit | |
− | + | |- | |
− | | | + | | X |
− | | | + | | 0x01 |
− | | | ||
|- | |- | ||
− | | | + | | Y |
− | | | + | | 0x02 |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | | | + | | Z |
− | + | | 0x04 | |
− | |||
− | |||
− | |||
− | | | ||
|- | |- | ||
− | | | + | | Y_ROT |
− | | | + | | 0x08 |
− | |||
|- | |- | ||
− | | | + | | X_ROT |
− | | | + | | 0x10 |
− | |||
− | |||
− | |||
− | |||
− | |||
|} | |} | ||
− | + | ==== Unlock Recipes ==== | |
− | |||
− | |||
− | |||
− | ==== | ||
− | |||
− | |||
{| class="wikitable" | {| class="wikitable" | ||
Line 3,067: | Line 3,538: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan=" | + | |rowspan="10"| 0x36 |
− | |rowspan=" | + | |rowspan="10"| Play |
− | |rowspan=" | + | |rowspan="10"| Client |
− | | | + | |- |
+ | | Action | ||
| VarInt | | VarInt | ||
− | | | + | | 0: init, 1: add, 2: remove |
|- | |- | ||
− | | | + | | Crafting Recipe Book Open |
− | | | + | | Boolean |
− | | | + | | If true, then the crafting recipe book will be open when the player opens its inventory. |
+ | |- | ||
+ | | Crafting Recipe Book Filter Active | ||
+ | | Boolean | ||
+ | | If true, then the filtering option is active when the players opens its inventory. | ||
+ | |- | ||
+ | | Smelting Recipe Book Open | ||
+ | | Boolean | ||
+ | | If true, then the smelting recipe book will be open when the player opens its inventory. | ||
+ | |- | ||
+ | | Smelting Recipe Book Filter Active | ||
+ | | Boolean | ||
+ | | If true, then the filtering option is active when the players opens its inventory. | ||
+ | |- | ||
+ | | Array size 1 | ||
+ | | VarInt | ||
+ | | Number of elements in the following array | ||
+ | |- | ||
+ | | Recipe IDs | ||
+ | | Array of Identifier | ||
+ | | | ||
+ | |- | ||
+ | | Array size 2 | ||
+ | | Optional VarInt | ||
+ | | Number of elements in the following array, only present if mode is 0 (init) | ||
+ | |- | ||
+ | | Recipe IDs | ||
+ | | Optional Array of Identifier, only present if mode is 0 (init) | ||
+ | | | ||
|} | |} | ||
+ | Action: | ||
+ | * 0 (init) = All the recipes in the list 2 will added to the recipe book. All the recipes in list 1 will be tagged as displayed, recipes that aren't tagged will be shown in the notification. VERIFY LIST ORDER? | ||
+ | * 1 (add) = All the recipes in the list are added and their icon will be shown in the notification. | ||
+ | * 2 (remove) = Remove all the recipes in the list. This allows them to re-displayed when they are readded. | ||
− | ==== | + | ==== Destroy Entities ==== |
− | Sent by the server to | + | Sent by the server when a list of entities is to be destroyed on the client. |
{| class="wikitable" | {| class="wikitable" | ||
Line 3,094: | Line 3,598: | ||
|rowspan="2"| Play | |rowspan="2"| Play | ||
|rowspan="2"| Client | |rowspan="2"| Client | ||
− | | | + | | Count |
− | | | + | | VarInt |
− | | | + | | Number of elements in the following array |
|- | |- | ||
− | | | + | | Entity IDs |
− | | | + | | Array of VarInt |
− | | | + | | The list of entities of destroy |
|} | |} | ||
− | + | ==== Remove Entity Effect ==== | |
{| class="wikitable" | {| class="wikitable" | ||
− | ! | + | ! Packet ID |
+ | ! State | ||
+ | ! Bound To | ||
+ | ! Field Name | ||
+ | ! Field Type | ||
+ | ! Notes | ||
|- | |- | ||
− | | | + | |rowspan="2"| 0x38 |
+ | |rowspan="2"| Play | ||
+ | |rowspan="2"| Client | ||
+ | | Entity ID | ||
+ | | VarInt | ||
+ | | | ||
|- | |- | ||
− | | | + | | Effect ID |
+ | | Byte | ||
+ | | See {{Minecraft Wiki|Status effect#List of effects|this table}} | ||
+ | |} | ||
+ | |||
+ | ==== Resource Pack Send ==== | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! Packet ID | ||
+ | ! State | ||
+ | ! Bound To | ||
+ | ! Field Name | ||
+ | ! Field Type | ||
+ | ! Notes | ||
|- | |- | ||
− | | | + | |rowspan="2"| 0x39 |
+ | |rowspan="2"| Play | ||
+ | |rowspan="2"| Client | ||
+ | | URL | ||
+ | | String (32767) | ||
+ | | The URL to the resource pack. | ||
|- | |- | ||
− | | | + | | Hash |
− | | | + | | String (40) |
− | | | + | | A 40 character hexadecimal and lowercase [[wikipedia:SHA-1|SHA-1]] hash of the resource pack file. (must be lower case in order to work)<br />If it's not a 40 character hexadecimal string, the client will not use it for hash verification and likely waste bandwidth — but it will still treat it as a unique id |
|} | |} | ||
− | + | ==== Respawn ==== | |
− | + | To change the player's dimension (overworld/nether/end), send them a respawn packet with the appropriate dimension, followed by prechunks/chunks for the new dimension, and finally a position and look packet. You do not need to unload chunks, the client will do it automatically. | |
{| class="wikitable" | {| class="wikitable" | ||
Line 3,127: | Line 3,659: | ||
! State | ! State | ||
! Bound To | ! Bound To | ||
− | ! | + | ! Field Name |
! Field Type | ! Field Type | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan=" | + | |rowspan="3"| 0x3A |
− | |rowspan=" | + | |rowspan="3"| Play |
− | |rowspan=" | + | |rowspan="3"| Client |
− | | | + | | Dimension |
− | | | + | | Int Enum |
− | | | + | | -1: The Nether, 0: The Overworld, 1: The End |
+ | |- | ||
+ | | Gamemode | ||
+ | | Unsigned Byte | ||
+ | | 0: survival, 1: creative, 2: adventure, 3: spectator. The hardcore flag is not included | ||
|- | |- | ||
− | ! | + | | Level Type |
+ | | String (16) | ||
+ | | Same as [[#Join Game|Join Game]] | ||
+ | |} | ||
+ | |||
+ | {{Warning2|Avoid changing player's dimension to same dimension they were already in unless they are dead. If you change the dimension to one they are already in, weird bugs can occur, such as the player being unable to attack other players in new world (until they die and respawn). | ||
+ | |||
+ | If you must respawn a player in the same dimension without killing them, send two respawn packets, one to a different world and then another to the world you want. You do not need to complete the first respawn; it only matters that you send two packets.}} | ||
+ | |||
+ | ==== Entity Head Look ==== | ||
+ | |||
+ | Changes the direction an entity's head is facing. | ||
+ | |||
+ | While sending the Entity Look packet changes the vertical rotation of the head, sending this packet appears to be necessary to rotate the head horizontally. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! Packet ID | ||
+ | ! State | ||
+ | ! Bound To | ||
! Field Name | ! Field Name | ||
− | ! | + | ! Field Type |
− | ! | + | ! Notes |
|- | |- | ||
− | | | + | |rowspan="2"| 0x3B |
− | | | + | |rowspan="2"| Play |
− | | | + | |rowspan="2"| Client |
− | | | + | | Entity ID |
+ | | VarInt | ||
+ | | | ||
|- | |- | ||
− | | | + | | Head Yaw |
− | | | + | | Angle |
− | | | + | | New angle, not a delta |
− | | | + | |} |
+ | |||
+ | ==== Select Advancement Tab ==== | ||
+ | |||
+ | Sent by the server to indicate that the client should switch advancement tab. Sent either when the client switches tab in the GUI or when an advancement in another tab is made. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! Packet ID | ||
+ | ! State | ||
+ | ! Bound To | ||
+ | ! Field Name | ||
+ | ! Field Type | ||
+ | ! Notes | ||
|- | |- | ||
− | | | + | |rowspan="2"| 0x3C |
− | | | + | |rowspan="2"| Play |
− | | | + | |rowspan="2"| Client |
+ | | Has id | ||
+ | | Boolean | ||
+ | | Indicates if the next field is present | ||
|- | |- | ||
− | | | + | | Optional Identifier |
− | | | + | | String (32767) |
− | | | + | | See below |
+ | |} | ||
+ | |||
+ | The Identifier can be one of the following: | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! Optional Identifier | ||
|- | |- | ||
− | | | + | | minecraft:story/root |
− | |||
− | |||
− | |||
|- | |- | ||
− | | | + | | minecraft:nether/root |
− | |||
− | |||
|- | |- | ||
− | | | + | | minecraft:end/root |
− | |||
− | |||
− | |||
|- | |- | ||
− | | | + | | minecraft:adventure/root |
− | |||
− | |||
|- | |- | ||
+ | | minecraft:husbandry/root | ||
+ | |} | ||
+ | |||
+ | If no or an invalid identifier is sent, the client will switch to the first tab in the GUI. | ||
+ | |||
+ | ==== World Border ==== | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! Packet ID | ||
+ | ! State | ||
+ | ! Bound To | ||
+ | !colspan="2"| Field Name | ||
+ | ! Field Type | ||
+ | ! Notes | ||
+ | |- | ||
+ | |rowspan="18"| 0x3D | ||
+ | |rowspan="18"| Play | ||
+ | |rowspan="18"| Client | ||
+ | |colspan="2"| Action | ||
+ | | VarInt Enum | ||
+ | | Determines the format of the rest of the packet | ||
+ | |- | ||
+ | ! Action | ||
+ | ! Field Name | ||
+ | ! | ||
+ | ! | ||
+ | |- | ||
+ | | 0: set size | ||
+ | | Diameter | ||
+ | | Double | ||
+ | | Length of a single side of the world border, in meters | ||
+ | |- | ||
+ | |rowspan="3"| 1: lerp size | ||
| Old Diameter | | Old Diameter | ||
| Double | | Double | ||
Line 3,191: | Line 3,791: | ||
| Number of real-time ''milli''seconds until New Diameter is reached. It appears that Notchian server does not sync world border speed to game ticks, so it gets out of sync with server lag. If the world border is not moving, this is set to 0. | | Number of real-time ''milli''seconds until New Diameter is reached. It appears that Notchian server does not sync world border speed to game ticks, so it gets out of sync with server lag. If the world border is not moving, this is set to 0. | ||
|- | |- | ||
− | | | + | |rowspan="2"| 2: set center |
− | | | + | | X |
− | | | + | | Double |
+ | | | ||
|- | |- | ||
− | | | + | | Z |
− | | | + | | Double |
− | | | + | | |
|- | |- | ||
− | | Warning Blocks | + | |rowspan="8"| 3: initialize |
− | | VarInt | + | | X |
+ | | Double | ||
+ | | | ||
+ | |- | ||
+ | | Z | ||
+ | | Double | ||
+ | | | ||
+ | |- | ||
+ | | Old Diameter | ||
+ | | Double | ||
+ | | Current length of a single side of the world border, in meters | ||
+ | |- | ||
+ | | New Diameter | ||
+ | | Double | ||
+ | | Target length of a single side of the world border, in meters | ||
+ | |- | ||
+ | | Speed | ||
+ | | VarLong | ||
+ | | Number of real-time ''milli''seconds until New Diameter is reached. It appears that Notchian server does not sync world border speed to game ticks, so it gets out of sync with server lag. If the world border is not moving, this is set to 0. | ||
+ | |- | ||
+ | | Portal Teleport Boundary | ||
+ | | VarInt | ||
+ | | Resulting coordinates from a portal teleport are limited to ±value. Usually 29999984. | ||
+ | |- | ||
+ | | Warning Time | ||
+ | | VarInt | ||
+ | | In seconds as set by <code>/worldborder warning time</code> | ||
+ | |- | ||
+ | | Warning Blocks | ||
+ | | VarInt | ||
| In meters | | In meters | ||
|- | |- | ||
Line 3,243: | Line 3,873: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan="1"| | + | |rowspan="1"| 0x3E |
|rowspan="1"| Play | |rowspan="1"| Play | ||
|rowspan="1"| Client | |rowspan="1"| Client | ||
Line 3,270: | Line 3,900: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan="1"| | + | |rowspan="1"| 0x3F |
|rowspan="1"| Play | |rowspan="1"| Play | ||
|rowspan="1"| Client | |rowspan="1"| Client | ||
Line 3,278: | Line 3,908: | ||
|} | |} | ||
− | ==== | + | ==== Update View Position ==== |
+ | |||
+ | {{Need Info|Why is this even needed? Is there a better name for it? My guess is that it's something to do with logical behavior with latency, but it still seems weird.}} | ||
+ | |||
+ | Updates the client's location. This is used to determine what chunks should remain loaded and if a chunk load should be ignored; chunks outside of the view distance may be unloaded. | ||
− | + | Sent whenever the player moves across a chunk border horizontally, and also (according to testing) for any integer change in the vertical axis, even if it doesn't go across a chunk section border. | |
{| class="wikitable" | {| class="wikitable" | ||
Line 3,290: | Line 3,924: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan="2"| | + | |rowspan="2"| 0x40 |
|rowspan="2"| Play | |rowspan="2"| Play | ||
|rowspan="2"| Client | |rowspan="2"| Client | ||
− | | | + | | Chunk X |
− | | | + | | VarInt |
− | | | + | | Chunk X coordinate of the player's position |
|- | |- | ||
− | | | + | | Chunk Z |
− | | | + | | VarInt |
− | | | + | | Chunk Z coordinate of the player's position |
|} | |} | ||
− | ==== | + | ==== Update View Distance ==== |
− | + | Sent by the integrated singleplayer server when changing render distance. Does not appear to be used by the dedicated server, as <code>view-distance</code> in server.properties cannot be changed at runtime. | |
{| class="wikitable" | {| class="wikitable" | ||
Line 3,314: | Line 3,948: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan="2"| | + | |rowspan="1"| 0x41 |
− | |rowspan="2"| Play | + | |rowspan="1"| Play |
+ | |rowspan="1"| Client | ||
+ | | View Distance | ||
+ | | VarInt | ||
+ | | Render distance (2-32) | ||
+ | |} | ||
+ | |||
+ | ==== Display Scoreboard ==== | ||
+ | |||
+ | This is sent to the client when it should display a scoreboard. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! Packet ID | ||
+ | ! State | ||
+ | ! Bound To | ||
+ | ! Field Name | ||
+ | ! Field Type | ||
+ | ! Notes | ||
+ | |- | ||
+ | |rowspan="2"| 0x42 | ||
+ | |rowspan="2"| Play | ||
+ | |rowspan="2"| Client | ||
+ | | Position | ||
+ | | Byte | ||
+ | | The position of the scoreboard. 0: list, 1: sidebar, 2: below name, 3 - 18: team specific sidebar, indexed as 3 + team color. | ||
+ | |- | ||
+ | | Score Name | ||
+ | | String (16) | ||
+ | | The unique name for the scoreboard to be displayed. | ||
+ | |} | ||
+ | |||
+ | ==== Entity Metadata ==== | ||
+ | |||
+ | Updates one or more [[Entities#Entity Metadata Format|metadata]] properties for an existing entity. Any properties not included in the Metadata field are left unchanged. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! Packet ID | ||
+ | ! State | ||
+ | ! Bound To | ||
+ | ! Field Name | ||
+ | ! Field Type | ||
+ | ! Notes | ||
+ | |- | ||
+ | |rowspan="2"| 0x43 | ||
+ | |rowspan="2"| Play | ||
|rowspan="2"| Client | |rowspan="2"| Client | ||
| Entity ID | | Entity ID | ||
Line 3,338: | Line 4,016: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan="2"| | + | |rowspan="2"| 0x44 |
|rowspan="2"| Play | |rowspan="2"| Play | ||
|rowspan="2"| Client | |rowspan="2"| Client | ||
Line 3,362: | Line 4,040: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan="4"| | + | |rowspan="4"| 0x45 |
|rowspan="4"| Play | |rowspan="4"| Play | ||
|rowspan="4"| Client | |rowspan="4"| Client | ||
Line 3,392: | Line 4,070: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan="3"| | + | |rowspan="3"| 0x46 |
|rowspan="3"| Play | |rowspan="3"| Play | ||
|rowspan="3"| Client | |rowspan="3"| Client | ||
Line 3,420: | Line 4,098: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan="3"| | + | |rowspan="3"| 0x47 |
|rowspan="3"| Play | |rowspan="3"| Play | ||
|rowspan="3"| Client | |rowspan="3"| Client | ||
Line 3,450: | Line 4,128: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan="3"| | + | |rowspan="3"| 0x48 |
|rowspan="3"| Play | |rowspan="3"| Play | ||
|rowspan="3"| Client | |rowspan="3"| Client | ||
Line 3,478: | Line 4,156: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan="4"| | + | |rowspan="4"| 0x49 |
|rowspan="4"| Play | |rowspan="4"| Play | ||
|rowspan="4"| Client | |rowspan="4"| Client | ||
Line 3,490: | Line 4,168: | ||
|- | |- | ||
| Objective Value | | Objective Value | ||
− | | Optional | + | | Optional Chat |
| Only if mode is 0 or 2. The text to be displayed for the score | | Only if mode is 0 or 2. The text to be displayed for the score | ||
|- | |- | ||
| Type | | Type | ||
− | | Optional | + | | Optional VarInt enum |
− | | Only if mode is 0 or 2. | + | | Only if mode is 0 or 2. 0 = "integer", 1 = "hearts". |
|} | |} | ||
Line 3,508: | Line 4,186: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan="3"| | + | |rowspan="3"| 0x4A |
|rowspan="3"| Play | |rowspan="3"| Play | ||
|rowspan="3"| Client | |rowspan="3"| Client | ||
Line 3,536: | Line 4,214: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan="23"| | + | |rowspan="23"| 0x4B |
|rowspan="23"| Play | |rowspan="23"| Play | ||
|rowspan="23"| Client | |rowspan="23"| Client | ||
Line 3,549: | Line 4,227: | ||
|rowspan="9"| 0: create team | |rowspan="9"| 0: create team | ||
| Team Display Name | | Team Display Name | ||
− | | | + | | Chat |
| | | | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| Friendly Flags | | Friendly Flags | ||
Line 3,572: | Line 4,242: | ||
| <code>always</code>, <code>pushOtherTeams</code>, <code>pushOwnTeam</code>, <code>never</code> | | <code>always</code>, <code>pushOtherTeams</code>, <code>pushOwnTeam</code>, <code>never</code> | ||
|- | |- | ||
− | | Color | + | | Team Color |
− | | | + | | VarInt enum |
− | | | + | | Used to color the name of players on the team; see below |
+ | |- | ||
+ | | Team Prefix | ||
+ | | Chat | ||
+ | | Displayed before the names of players that are part of this team | ||
+ | |- | ||
+ | | Team Suffix | ||
+ | | Chat | ||
+ | | Displayed after the names of players that are part of this team | ||
|- | |- | ||
| Entity Count | | Entity Count | ||
Line 3,591: | Line 4,269: | ||
|rowspan="7"| 2: update team info | |rowspan="7"| 2: update team info | ||
| Team Display Name | | Team Display Name | ||
− | | | + | | Chat |
| | | | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| Friendly Flags | | Friendly Flags | ||
Line 3,614: | Line 4,284: | ||
| <code>always</code>, <code>pushOtherTeams</code>, <code>pushOwnTeam</code>, <code>never</code> | | <code>always</code>, <code>pushOtherTeams</code>, <code>pushOwnTeam</code>, <code>never</code> | ||
|- | |- | ||
− | | Color | + | | Team Color |
− | | | + | | VarInt enum |
− | | | + | | Used to color the name of players on the team; see below |
+ | |- | ||
+ | | Team Prefix | ||
+ | | Chat | ||
+ | | Displayed before the names of players that are part of this team | ||
+ | |- | ||
+ | | Team Suffix | ||
+ | | Chat | ||
+ | | Displayed after the names of players that are part of this team | ||
|- | |- | ||
|rowspan="2"| 3: add players to team | |rowspan="2"| 3: add players to team | ||
Line 3,635: | Line 4,313: | ||
| Array of String (40) | | Array of String (40) | ||
| Identifiers for the entities removed. For players, this is their username; for other entities, it is their UUID. | | Identifiers for the entities removed. For players, this is their username; for other entities, it is their UUID. | ||
+ | |} | ||
+ | |||
+ | Team Color: The color of a team defines how the names of the team members are visualized; any formatting code can be used. The following table lists all the possible values. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! ID | ||
+ | ! Formatting | ||
+ | |- | ||
+ | | 0-15 | ||
+ | | Color formatting, same values as [[Chat]] colors. | ||
+ | |- | ||
+ | | 16 | ||
+ | | Obfuscated | ||
+ | |- | ||
+ | | 17 | ||
+ | | Bold | ||
+ | |- | ||
+ | | 18 | ||
+ | | Strikethrough | ||
+ | |- | ||
+ | | 19 | ||
+ | | Underlined | ||
+ | |- | ||
+ | | 20 | ||
+ | | Italic | ||
+ | |- | ||
+ | | 21 | ||
+ | | Reset | ||
|} | |} | ||
Line 3,649: | Line 4,355: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan="4"| | + | |rowspan="4"| 0x4C |
|rowspan="4"| Play | |rowspan="4"| Play | ||
|rowspan="4"| Client | |rowspan="4"| Client | ||
Line 3,681: | Line 4,387: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan="1"| | + | |rowspan="1"| 0x4D |
|rowspan="1"| Play | |rowspan="1"| Play | ||
|rowspan="1"| Client | |rowspan="1"| Client | ||
Line 3,705: | Line 4,411: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan="2"| | + | |rowspan="2"| 0x4E |
|rowspan="2"| Play | |rowspan="2"| Play | ||
|rowspan="2"| Client | |rowspan="2"| Client | ||
Line 3,727: | Line 4,433: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan="10"| | + | |rowspan="10"| 0x4F |
|rowspan="10"| Play | |rowspan="10"| Play | ||
|rowspan="10"| Client | |rowspan="10"| Client | ||
Line 3,782: | Line 4,488: | ||
The title is visible on screen for Fade In + Stay + Fade Out ticks. | The title is visible on screen for Fade In + Stay + Fade Out ticks. | ||
− | ==== Sound Effect ==== | + | ==== Entity Sound Effect ==== |
− | This packet is used to play a number of hardcoded sound events. For custom sounds, use [[#Named Sound Effect|Named Sound Effect]]. | + | Plays a sound effect from an entity. |
+ | |||
+ | {| class="wikitable" | ||
+ | ! Packet ID | ||
+ | ! State | ||
+ | ! Bound To | ||
+ | ! Field Name | ||
+ | ! Field Type | ||
+ | ! Notes | ||
+ | |- | ||
+ | |rowspan="5"| 0x50 | ||
+ | |rowspan="5"| Play | ||
+ | |rowspan="5"| Client | ||
+ | | Sound ID | ||
+ | | VarInt | ||
+ | | ID of hardcoded sound event ([https://pokechu22.github.io/Burger/1.14.4.html#sounds events] as of 1.14.4) | ||
+ | |- | ||
+ | | Sound Category | ||
+ | | VarInt Enum | ||
+ | | The category that this sound will be played from ([https://gist.github.com/konwboj/7c0c380d3923443e9d55 current categories]) | ||
+ | |- | ||
+ | | Entity ID | ||
+ | | VarInt | ||
+ | | | ||
+ | |- | ||
+ | | Volume | ||
+ | | Float | ||
+ | | 1.0 is 100%, capped between 0.0 and 1.0 by Notchian clients | ||
+ | |- | ||
+ | | Pitch | ||
+ | | Float | ||
+ | | Float between 0.5 and 2.0 by Notchian clients | ||
+ | |} | ||
+ | |||
+ | ==== Sound Effect ==== | ||
+ | |||
+ | This packet is used to play a number of hardcoded sound events. For custom sounds, use [[#Named Sound Effect|Named Sound Effect]]. | ||
{{Warning|Numeric sound effect IDs are liable to change between versions}} | {{Warning|Numeric sound effect IDs are liable to change between versions}} | ||
Line 3,796: | Line 4,538: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan="7"| | + | |rowspan="7"| 0x51 |
|rowspan="7"| Play | |rowspan="7"| Play | ||
|rowspan="7"| Client | |rowspan="7"| Client | ||
| Sound ID | | Sound ID | ||
| VarInt | | VarInt | ||
− | | ID of hardcoded sound event ([ | + | | ID of hardcoded sound event ([https://pokechu22.github.io/Burger/1.14.4.html#sounds events] as of 1.14.4) |
|- | |- | ||
| Sound Category | | Sound Category | ||
Line 3,826: | Line 4,568: | ||
| Float | | Float | ||
| Float between 0.5 and 2.0 by Notchian clients | | Float between 0.5 and 2.0 by Notchian clients | ||
− | |||
|} | |} | ||
− | ==== | + | ==== Stop Sound ==== |
− | |||
− | |||
{| class="wikitable" | {| class="wikitable" | ||
Line 3,841: | Line 4,580: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan=" | + | |rowspan="3"| 0x52 |
− | |rowspan=" | + | |rowspan="3"| Play |
− | |rowspan=" | + | |rowspan="3"| Client |
− | | | + | | Flags |
− | | | + | | Byte |
− | | | + | | Controls which fields are present. |
+ | |- | ||
+ | | Source | ||
+ | | Optional VarInt enum | ||
+ | | Only if flags is 3 or 1 (bit mask 0x1). See below. If not present, then sounds from all sources are cleared. | ||
|- | |- | ||
− | | | + | | Sound |
− | | [[ | + | | Optional Identifier |
− | | | + | | Only if flags is 2 or 3 (bit mask 0x2). A sound effect name, see [[#Named Sound Effect|Named Sound Effect]]. If not present, then all sounds are cleared. |
+ | |} | ||
+ | |||
+ | Categories: | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! Name !! Value | ||
+ | |- | ||
+ | | master || 0 | ||
+ | |- | ||
+ | | music || 1 | ||
+ | |- | ||
+ | | record || 2 | ||
+ | |- | ||
+ | | weather || 3 | ||
+ | |- | ||
+ | | block || 4 | ||
+ | |- | ||
+ | | hostile || 5 | ||
+ | |- | ||
+ | | neutral || 6 | ||
+ | |- | ||
+ | | player || 7 | ||
+ | |- | ||
+ | | ambient || 8 | ||
+ | |- | ||
+ | | voice || 9 | ||
|} | |} | ||
− | ==== | + | ==== Player List Header And Footer ==== |
− | + | This packet may be used by custom servers to display additional information above/below the player list. It is never sent by the Notchian server. | |
{| class="wikitable" | {| class="wikitable" | ||
Line 3,865: | Line 4,634: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan=" | + | |rowspan="2"| 0x53 |
− | |rowspan=" | + | |rowspan="2"| Play |
− | |rowspan=" | + | |rowspan="2"| Client |
− | | | + | | Header |
− | | | + | | [[Chat]] |
− | | | + | | To remove the header, send a empty translatable component: {"translate":""} |
− | |- | + | |- |
− | | | + | | Footer |
− | | | + | | [[Chat]] |
− | | | + | | To remove the footer, send a empty translatable component: {"translate":""} |
− | |||
− | |||
− | |||
− | |||
|} | |} | ||
− | ==== | + | ==== NBT Query Response ==== |
− | + | Sent in response to [[#Query Block NBT|Query Block NBT]] or [[#Query Entity NBT|Query Entity NBT]]. | |
{| class="wikitable" | {| class="wikitable" | ||
Line 3,893: | Line 4,658: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan=" | + | |rowspan="2"| 0x54 |
− | |rowspan=" | + | |rowspan="2"| Play |
− | |rowspan=" | + | |rowspan="2"| Client |
− | | | + | | Transaction ID |
| VarInt | | VarInt | ||
− | | | + | | Can be compared to the one sent in the original query packet. |
|- | |- | ||
− | | X | + | | NBT |
+ | | [[NBT|NBT Tag]] | ||
+ | | The NBT of the block or entity. May be a TAG_END (0) in which case no NBT is present. | ||
+ | |} | ||
+ | |||
+ | ==== Collect Item ==== | ||
+ | |||
+ | Sent by the server when someone picks up an item lying on the ground — its sole purpose appears to be the animation of the item flying towards you. It doesn't destroy the entity in the client memory, and it doesn't add it to your inventory. The server only checks for items to be picked up after each [[#Player Position|Player Position]] (and [[#Player Position And Look|Player Position And Look]]) packet sent by the client. The collector entity can be any entity; it does not have to be a player. The collected entity also can be any entity, but the Notchian server only uses this for items, experience orbs, and the different varieties of arrows. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! Packet ID | ||
+ | ! State | ||
+ | ! Bound To | ||
+ | ! Field Name | ||
+ | ! Field Type | ||
+ | ! Notes | ||
+ | |- | ||
+ | |rowspan="3"| 0x55 | ||
+ | |rowspan="3"| Play | ||
+ | |rowspan="3"| Client | ||
+ | | Collected Entity ID | ||
+ | | VarInt | ||
+ | | | ||
+ | |- | ||
+ | | Collector Entity ID | ||
+ | | VarInt | ||
+ | | | ||
+ | |- | ||
+ | | Pickup Item Count | ||
+ | | VarInt | ||
+ | | Seems to be 1 for XP orbs, otherwise the number of items in the stack. | ||
+ | |} | ||
+ | |||
+ | ==== Entity Teleport ==== | ||
+ | |||
+ | This packet is sent by the server when an entity moves more than 8 blocks. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! Packet ID | ||
+ | ! State | ||
+ | ! Bound To | ||
+ | ! Field Name | ||
+ | ! Field Type | ||
+ | ! Notes | ||
+ | |- | ||
+ | |rowspan="7"| 0x56 | ||
+ | |rowspan="7"| Play | ||
+ | |rowspan="7"| Client | ||
+ | | Entity ID | ||
+ | | VarInt | ||
+ | | | ||
+ | |- | ||
+ | | X | ||
| Double | | Double | ||
| | | | ||
Line 3,935: | Line 4,752: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan="9"| | + | |rowspan="9"| 0x57 |
|rowspan="9"| Play | |rowspan="9"| Play | ||
|rowspan="9"| Client | |rowspan="9"| Client | ||
Line 4,121: | Line 4,938: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan="6"| | + | |rowspan="6"| 0x58 |
|rowspan="6"| Play | |rowspan="6"| Play | ||
|rowspan="6"| Client | |rowspan="6"| Client | ||
Line 4,267: | Line 5,084: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan="5"| | + | |rowspan="5"| 0x59 |
|rowspan="5"| Play | |rowspan="5"| Play | ||
|rowspan="5"| Client | |rowspan="5"| Client | ||
Line 4,296: | Line 5,113: | ||
* 0x02: Show particles - should all particles from this effect be hidden? Effects with particles hidden are not included in the calculation of the effect color, and are not rendered on the HUD (but are still rendered within the inventory). Usually should be enabled. | * 0x02: Show particles - should all particles from this effect be hidden? Effects with particles hidden are not included in the calculation of the effect color, and are not rendered on the HUD (but are still rendered within the inventory). Usually should be enabled. | ||
− | === | + | ==== Declare Recipes ==== |
− | + | {| class="wikitable" | |
− | |||
− | |||
− | |||
− | {| class="wikitable" | ||
! Packet ID | ! Packet ID | ||
! State | ! State | ||
! Bound To | ! Bound To | ||
− | ! Field Name | + | !colspan="2"| Field Name |
− | ! Field Type | + | !colspan="2"| Field Type |
! Notes | ! Notes | ||
|- | |- | ||
− | | | + | |rowspan="4"| 0x5A |
− | | Play | + | |rowspan="4"| Play |
− | | | + | |rowspan="4"| Client |
− | | | + | |colspan="2"| Num Recipes |
− | | | + | |colspan="2"| VarInt |
− | | The | + | | Number of elements in the following array |
+ | |- | ||
+ | |rowspan="3"| Recipe | ||
+ | | Recipe ID | ||
+ | |rowspan="3"| Array | ||
+ | | Identifier | ||
+ | | | ||
+ | |- | ||
+ | | Type | ||
+ | | String | ||
+ | | The recipe type, see below | ||
+ | |- | ||
+ | | Data | ||
+ | | Optional, varies | ||
+ | | Additional data for the recipe. For some types, there will be no data. | ||
|} | |} | ||
− | + | Recipe types: | |
− | |||
− | |||
{| class="wikitable" | {| class="wikitable" | ||
− | ! | + | ! Type |
− | ! | + | ! Description |
− | ! | + | ! Data |
− | ! | + | |- |
− | + | | <code>crafting_shapeless</code> | |
− | + | | Shapeless crafting recipe. All items in the ingredient list must be present, but in any order/slot. | |
+ | | As follows: | ||
+ | {| class="wikitable" | ||
+ | ! Name | ||
+ | ! Type | ||
+ | ! Description | ||
+ | |- | ||
+ | | Group | ||
+ | | String | ||
+ | | Used to group similar recipes together in the recipe book. Tag is present in recipe JSON. | ||
+ | |- | ||
+ | | Ingredient count | ||
+ | | VarInt | ||
+ | | Number of elements in the following array | ||
+ | |- | ||
+ | | Ingredients | ||
+ | | Array of Ingredient | ||
+ | | | ||
+ | |- | ||
+ | | Result | ||
+ | | [[Slot]] | ||
+ | | | ||
+ | |} | ||
|- | |- | ||
− | | | + | | <code>crafting_shaped</code> |
− | | | + | | Shaped crafting recipe. All items must be present in the same pattern (which may be flipped horizontally or translated) |
− | + | | As follows: | |
− | + | {| class="wikitable" | |
− | + | ! Name | |
− | + | ! Type | |
+ | ! Description | ||
+ | |- | ||
+ | | Width | ||
+ | | VarInt | ||
+ | | | ||
+ | |- | ||
+ | | Height | ||
+ | | VarInt | ||
+ | | | ||
+ | |- | ||
+ | | Group | ||
+ | | String | ||
+ | | Used to group similar recipes together in the recipe book. Tag is present in recipe JSON. | ||
+ | |- | ||
+ | | Ingredients | ||
+ | | Array of Ingredient | ||
+ | | Length is width * height. Indexed by x + (y * width). | ||
+ | |- | ||
+ | | Result | ||
+ | | [[Slot]] | ||
+ | | | ||
+ | |} | ||
|- | |- | ||
− | | | + | | <code>crafting_special_armordye</code> |
− | + | | Recipe for dying leather armor | |
− | + | | None | |
|- | |- | ||
− | | | + | | <code>crafting_special_bookcloning</code> |
− | | | + | | Recipe for copying contents of written books |
− | | | + | | None |
|- | |- | ||
− | | | + | | <code>crafting_special_mapcloning</code> |
− | | | + | | Recipe for copying maps |
− | | | + | | None |
− | | | + | |- |
− | + | | <code>crafting_special_mapextending</code> | |
− | = | + | | Recipe for adding paper to maps |
− | + | | None | |
− | Used to | + | |- |
+ | | <code>crafting_special_firework_rocket</code> | ||
+ | | Recipe for making firework rockets | ||
+ | | None | ||
+ | |- | ||
+ | | <code>crafting_special_firework_star</code> | ||
+ | | Recipe for making firework stars | ||
+ | | None | ||
+ | |- | ||
+ | | <code>crafting_special_firework_star_fade</code> | ||
+ | | Recipe for making firework stars fade between multiple colors | ||
+ | | None | ||
+ | |- | ||
+ | | <code>crafting_special_repairitem</code> | ||
+ | | Recipe for repairing items via crafting | ||
+ | | None | ||
+ | |- | ||
+ | | <code>crafting_special_tippedarrow</code> | ||
+ | | Recipe for crafting tipped arrows | ||
+ | | None | ||
+ | |- | ||
+ | | <code>crafting_special_bannerduplicate</code> | ||
+ | | Recipe for copying banner patterns | ||
+ | | None | ||
+ | |- | ||
+ | | <code>crafting_special_banneraddpattern</code> | ||
+ | | Recipe for adding patterns to banners | ||
+ | | None | ||
+ | |- | ||
+ | | <code>crafting_special_shielddecoration</code> | ||
+ | | Recipe for applying a banner's pattern to a shield | ||
+ | | None | ||
+ | |- | ||
+ | | <code>crafting_special_shulkerboxcoloring</code> | ||
+ | | Recipe for recoloring a shulker box | ||
+ | | None | ||
+ | |- | ||
+ | | <code>smelting</code> | ||
+ | | Smelting recipe | ||
+ | | As follows: | ||
+ | {| class="wikitable" | ||
+ | ! Name | ||
+ | ! Type | ||
+ | ! Description | ||
+ | |- | ||
+ | | Group | ||
+ | | String | ||
+ | | Used to group similar recipes together in the recipe book. | ||
+ | |- | ||
+ | | Ingredient | ||
+ | | Ingredient | ||
+ | | | ||
+ | |- | ||
+ | | Result | ||
+ | | [[Slot]] | ||
+ | | | ||
+ | |- | ||
+ | | Experience | ||
+ | | Float | ||
+ | | | ||
+ | |- | ||
+ | | Cooking time | ||
+ | | VarInt | ||
+ | | | ||
+ | |} | ||
+ | |} | ||
− | + | Ingredient is defined as: | |
{| class="wikitable" | {| class="wikitable" | ||
− | ! | + | ! Name |
− | ! | + | ! Type |
− | ! | + | ! Description |
− | + | |- | |
− | + | | Count | |
− | + | | VarInt | |
+ | | Number of elements in the following array | ||
|- | |- | ||
− | | | + | | Items |
− | | | + | | Array of [[Slot]] |
− | | | + | | Any item in this array may be used for the recipe. The count of each item should be 1. |
− | |||
− | |||
− | |||
|} | |} | ||
− | ==== | + | ==== Tags ==== |
{| class="wikitable" | {| class="wikitable" | ||
Line 4,382: | Line 5,314: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan=" | + | |rowspan="4"| 0x5B |
− | |rowspan=" | + | |rowspan="4"| Play |
− | |rowspan=" | + | |rowspan="4"| Client |
− | | | + | | Block Tags |
− | | | + | | (See below) |
− | | See below | + | | IDs are block IDs |
+ | |- | ||
+ | | Item Tags | ||
+ | | (See below) | ||
+ | | IDs are item IDs | ||
+ | |- | ||
+ | | Fluid Tags | ||
+ | | (See below) | ||
+ | | IDs are fluid IDs | ||
+ | |- | ||
+ | | Entity Tags | ||
+ | | (See below) | ||
+ | | IDs are entity IDs | ||
|} | |} | ||
− | + | Tags look like: | |
{| class="wikitable" | {| class="wikitable" | ||
− | | | + | !colspan="2"| Field Name |
− | ! | + | !colspan="2"| Field Type |
− | |||
! Notes | ! Notes | ||
|- | |- | ||
− | | | + | |colspan="2"| Length |
− | | | + | |colspan="2"| VarInt |
− | | | + | | Number of elements in the following array |
+ | |- | ||
+ | |rowspan="3"| Tags | ||
+ | | Tag name | ||
+ | |rowspan="3"| Array | ||
+ | | Identifier | ||
+ | | | ||
+ | |- | ||
+ | | Count | ||
+ | | VarInt | ||
+ | | Number of elements in the following array | ||
|- | |- | ||
− | | | + | | Entries |
− | | | + | | Array of VarInt |
− | | | + | | Numeric ID of the block/item. |
|} | |} | ||
− | ==== | + | ==== Acknowledge Player Digging ==== |
− | |||
− | |||
{| class="wikitable" | {| class="wikitable" | ||
Line 4,419: | Line 5,370: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan=" | + | |rowspan="4"| 0x5C |
− | |rowspan=" | + | |rowspan="4"| Play |
− | |rowspan=" | + | |rowspan="4"| Client |
− | | | + | | Location |
− | | | + | | Position |
− | | | + | | Position where the digging was happening |
|- | |- | ||
− | | | + | | Block |
− | | | + | | VarInt |
− | | | + | | Block state ID of the block that should be at that position now. |
|- | |- | ||
− | | | + | | Status |
− | | VarInt | + | | VarInt enum |
− | | 0 | + | | Same as Player Digging. Only Started digging (0), Cancelled digging (1), and Finished digging (2) are used. |
|- | |- | ||
− | | | + | | Successful |
| Boolean | | Boolean | ||
− | | | + | | True if the digging succeeded; false if the client should undo any changes it made locally. (How does this work?) |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|} | |} | ||
− | + | === Serverbound === | |
− | + | ==== Teleport Confirm ==== | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | Sent by client as confirmation of [[#Player Position And Look (clientbound)|Player Position And Look]]. | |
− | |||
− | |||
− | |||
− | |||
{| class="wikitable" | {| class="wikitable" | ||
Line 4,471: | Line 5,404: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | | | + | | 0x00 |
− | + | | Play | |
− | + | | Server | |
− | | | + | | Teleport ID |
− | | | + | | VarInt |
− | | The ID | + | | The ID given by the [[#Player Position And Look (clientbound)|Player Position And Look]] packet |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|} | |} | ||
− | ==== | + | ==== Query Block NBT ==== |
+ | |||
+ | Used when <kbd>Shift</kbd>+<kbd>F3</kbd>+<kbd>I</kbd> is pressed while looking at a block. | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 4,497: | Line 5,424: | ||
! Notes | ! Notes | ||
|- | |- | ||
− | |rowspan="2"| | + | |rowspan="2"| 0x01 |
|rowspan="2"| Play | |rowspan="2"| Play | ||
|rowspan="2"| Server | |rowspan="2"| Server | ||
− | | | + | | Transaction ID |
− | | | + | | VarInt |
− | | | + | | An incremental ID so that the client can verify that the response matches. |
|- | |- | ||
− | | | + | | Location |
− | | | + | | Position |
− | | The | + | | The location of the block to check. |
|} | |} | ||
− | ==== | + | ==== Set Difficulty ==== |
− |