technical documentation for Minecraft b1.7.3

feat: initial commit

+25
LICENSE-MIT
··· 1 + Copyright (c) kokiriglade 2 + 3 + Permission is hereby granted, free of charge, to any 4 + person obtaining a copy of this software and associated 5 + documentation files (the "Software"), to deal in the 6 + Software without restriction, including without 7 + limitation the rights to use, copy, modify, merge, 8 + publish, distribute, sublicense, and/or sell copies of 9 + the Software, and to permit persons to whom the Software 10 + is furnished to do so, subject to the following 11 + conditions: 12 + 13 + The above copyright notice and this permission notice 14 + shall be included in all copies or substantial portions 15 + of the Software. 16 + 17 + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 + ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 + TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 + PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 + SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 + IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 + DEALINGS IN THE SOFTWARE.
+13
README.md
··· 1 + # Minecraft Beta 1.7.3 Documentation 2 + 3 + ## Licensing 4 + 5 + All content [MIT licensed][mit] unless otherwise noted. 6 + 7 + The following is [CC-BY-SA-4.0][ccbysa4]: 8 + 9 + - `docs/packets.md` 10 + - `docs/.assets/slots.png` 11 + 12 + [mit]: /LICENSE-MIT 13 + [ccbysa4]: https://creativecommons.org/licenses/by-sa/4.0/
docs/.assets/cc-by-sa.png

This is a binary file and will not be displayed.

docs/.assets/slots.png

This is a binary file and will not be displayed.

+820
docs/blocks.md
··· 1 + # Blocks 2 + 3 + For empty data values, assume it to **always** be `0`. 4 + 5 + ID is an `i8`, and metadata is an `i8` where the final 4 bits are the _metadata 6 + nibble_. 7 + 8 + | Name | ID | Data | 9 + | ------------------------ | --- | ------------------------------ | 10 + | Air | 0 | | 11 + | Stone | 1 | | 12 + | Grass Block | 2 | | 13 + | Dirt | 3 | | 14 + | Cobblestone | 4 | | 15 + | Wooden Planks | 5 | | 16 + | Oak Sapling | 6 | `0` | 17 + | Spruce Sapling | 6 | `1` | 18 + | Birch Sapling | 6 | `2` | 19 + | Bedrock | 7 | | 20 + | Water (Flowing) | 8 | [See below][fluid] | 21 + | Water (Still) | 9 | | 22 + | Lava (Flowing) | 10 | [See below][fluid] | 23 + | Lava (Still) | 11 | | 24 + | Sand | 12 | | 25 + | Gravel | 13 | | 26 + | Gold Ore | 14 | | 27 + | Iron Ore | 15 | | 28 + | Coal Ore | 16 | | 29 + | Oak Log | 17 | `0` | 30 + | Spruce Log | 17 | `1` | 31 + | Birch Log | 17 | `2` | 32 + | Oak Leaves | 18 | `0` | 33 + | Spruce Leaves | 18 | `1` | 34 + | Birch Leaves | 18 | `2` | 35 + | Sponge | 19 | | 36 + | Glass | 20 | | 37 + | Lapis Lazuli Ore | 21 | | 38 + | Lapis Lazuli Block | 22 | | 39 + | Dispenser | 23 | [See below][dispenser] | 40 + | Sandstone | 24 | | 41 + | Note Block | 25 | | 42 + | Bed | 26 | [See below][bed] | 43 + | Powered Rail | 27 | [See below][powered_rail] | 44 + | Detector Rail | 28 | [See below][detector_rail] | 45 + | Sticky Piston | 29 | [See below][piston] | 46 + | Cobweb | 30 | | 47 + | Dead Shrub | 31 | `0` | 48 + | Grass | 31 | `1` | 49 + | Fern | 31 | `2` | 50 + | Dead Bush | 32 | | 51 + | Piston | 33 | [See below][piston] | 52 + | Piston Head | 34 | [See below][piston_head] | 53 + | White Wool | 35 | `0` | 54 + | Orange Wool | 35 | `1` | 55 + | Magenta Wool | 35 | `2` | 56 + | Light Blue Wool | 35 | `3` | 57 + | Yellow Wool | 35 | `4` | 58 + | Lime Wool | 35 | `5` | 59 + | Pink Wool | 35 | `6` | 60 + | Gray Wool | 35 | `7` | 61 + | Light Gray (Silver) Wool | 35 | `8` | 62 + | Cyan Wool | 35 | `9` | 63 + | Purple Wool | 35 | `10` | 64 + | Blue Wool | 35 | `11` | 65 + | Brown Wool | 35 | `12` | 66 + | Green Wool | 35 | `13` | 67 + | Red Wool | 35 | `14` | 68 + | Black Wool | 35 | `15` | 69 + | Moving Piston | 36 | | 70 + | Dandelion | 37 | | 71 + | Rose | 38 | | 72 + | Brown Mushroom | 39 | | 73 + | Red Mushroom | 40 | | 74 + | Gold Block | 41 | | 75 + | Iron Block | 42 | | 76 + | Double Stone Slab | 43 | `0` | 77 + | Double Sandstone Slab | 43 | `1` | 78 + | Double Wooden Slab | 43 | `2` | 79 + | Double Cobblestone Slab | 43 | `3` | 80 + | Stone Slab | 44 | `0` | 81 + | Sandstone Slab | 44 | `1` | 82 + | Wooden Slab | 44 | `2` | 83 + | Cobblestone Slab | 44 | `3` | 84 + | Bricks | 45 | | 85 + | TNT | 46 | | 86 + | Bookshelves | 47 | | 87 + | Mossy Cobblestone | 48 | | 88 + | Obsidian | 49 | | 89 + | Torch | 50 | [See below][torch] | 90 + | Fire | 51 | [See below][fire] | 91 + | Monster Spawner | 52 | | 92 + | Wooden Stairs | 53 | [See below][stairs] | 93 + | Chest | 54 | | 94 + | Redstone Wire | 55 | [See below][redstone_wire] | 95 + | Diamond Ore | 56 | | 96 + | Diamond Block | 57 | | 97 + | Crafting Table | 58 | | 98 + | Wheat | 59 | [See below][wheat] | 99 + | Farmland | 60 | [See below][farmland] | 100 + | Furnace | 61 | [See below][furnace] | 101 + | Lit Furnace | 62 | [See below][furnace] | 102 + | Standing Sign | 63 | [See below][standing_sign] | 103 + | Wooden Door | 64 | [See below][door] | 104 + | Ladder | 65 | [See below][ladder] | 105 + | Rail | 66 | [See below][rail] | 106 + | Cobblestone Stairs | 67 | [See below][stairs] | 107 + | Wall-Mounted Sign | 68 | [See below][wall_sign] | 108 + | Lever | 69 | [See below][lever] | 109 + | Stone Pressure Plate | 70 | [See below][pressure_plate] | 110 + | Iron Door | 71 | [See below][door] | 111 + | Wooden Pressure Plate | 72 | [See below][pressure_plate] | 112 + | Redstone Ore | 73 | | 113 + | Glowing Redstone Ore | 74 | | 114 + | Redstone Torch (Off) | 75 | [See below][redstone_torch] | 115 + | Redstone Torch (On) | 76 | [See below][redstone_torch] | 116 + | Button | 77 | [See below][button] | 117 + | Snow Layer | 78 | [See below][snow_layer] | 118 + | Ice | 79 | | 119 + | Snow Block | 80 | | 120 + | Cactus | 81 | | 121 + | Clay Block | 82 | | 122 + | Sugar Cane | 83 | | 123 + | Jukebox | 84 | | 124 + | Fence | 85 | | 125 + | Pumpkin | 86 | [See below][pumpkin] | 126 + | Netherrack | 87 | | 127 + | Soul Sand | 88 | | 128 + | Glowstone | 89 | | 129 + | Nether Portal | 90 | | 130 + | Jack O Lantern | 91 | [See below][pumpkin] | 131 + | Cake | 92 | [See below][cake] | 132 + | Redstone Repeater (Off) | 93 | [See below][redstone_repeater] | 133 + | Redstone Repeater (On) | 94 | [See below][redstone_repeater] | 134 + | Locked Chest | 95 | | 135 + | Trapdoor | 96 | [See below][trapdoor] | 136 + 137 + ## Bed Metadata 138 + 139 + - Bit Usage: `H O F F` 140 + - Valid range: `0..15` 141 + 142 + ### Bit Definitions: 143 + 144 + - `FF`: Facing direction 145 + - `0 (00)`: Positive Z (South) 146 + - `1 (01)`: Negative X (West) 147 + - `2 (10)`: Negative Z (North) 148 + - `3 (11)`: Positive X (East) 149 + 150 + - `O`: Occupied status 151 + - `0`: Unoccupied 152 + - `1`: Occupied 153 + 154 + - `H`: Head piece 155 + - `0`: Foot piece 156 + - `1`: Head piece 157 + 158 + ### Examples: 159 + 160 + - `0 (0000)`: Foot, unoccupied, facing South 161 + - `5 (0101)`: Foot, unoccupied, facing West 162 + - `11 (1011)`: Head, unoccupied, facing East 163 + - `15 (1111)`: Head, occupied, facing East 164 + 165 + ## Fluid Metadata 166 + 167 + - Bit Usage: `F D D D` 168 + - Valid range: `0..15` 169 + 170 + ### Bit Definitions: 171 + 172 + - `DDD`: Distance to source 173 + - `0`: Source block or adjacent to source 174 + - `1-7`: Distance from source 175 + 176 + - `F`: Falling state 177 + - `0`: Normal horizontal flow 178 + - `1`: Falling vertically (acts like source for spreading) 179 + 180 + ### Examples: 181 + 182 + - `0 (0000)`: Source block 183 + - `3 (0011)`: Distance 3 from source, flowing horizontally 184 + - `8 (1000)`: Falling fluid (acts like source) 185 + - `11 (1011)`: Falling fluid with distance 3 (rare edge case) 186 + 187 + ## Dispenser Metadata 188 + 189 + - Bit Usage: `F F F F` 190 + - Valid range: `0..5` 191 + 192 + ### Bit Definitions: 193 + 194 + - `FFFF`: Facing direction 195 + - `0`: Negative Y (Down) 196 + - `1`: Positive Y (Up) 197 + - `2`: Negative Z (North) 198 + - `3`: Positive Z (South) 199 + - `4`: Negative X (West) 200 + - `5`: Positive X (East) 201 + 202 + ### Examples: 203 + 204 + - `0 (0000)`: Facing down 205 + - `2 (0010)`: Facing north 206 + - `4 (0100)`: Facing west 207 + - `5 (0101)`: Facing east 208 + 209 + ## Rail Metadata 210 + 211 + - Bit Usage: `D D D D` 212 + - Valid range: `0..9` 213 + 214 + ### Bit Definitions: 215 + 216 + - `DDDD`: Direction/Shape 217 + - `0`: North-South straight 218 + - `1`: East-West straight 219 + - `2`: East ascending (going up towards +X) 220 + - `3`: West ascending (going up towards -X) 221 + - `4`: North ascending (going up towards -Z) 222 + - `5`: South ascending (going up towards +Z) 223 + - `6`: South-East curve 224 + - `7`: South-West curve 225 + - `8`: North-West curve 226 + - `9`: North-East curve 227 + 228 + ### Examples: 229 + 230 + - `0 (0000)`: North-South straight 231 + - `6 (0110)`: South-East curve 232 + - `8 (1000)`: North-West curve 233 + - `9 (1001)`: North-East curve 234 + 235 + ## Powered Rail Metadata 236 + 237 + - Bit Usage: `P D D D` 238 + - Valid range: `0..13` 239 + 240 + ### Bit Definitions: 241 + 242 + - `DDD`: Direction/Shape 243 + - `0`: North-South straight 244 + - `1`: East-West straight 245 + - `2`: East ascending (going up towards +X) 246 + - `3`: West ascending (going up towards -X) 247 + - `4`: North ascending (going up towards -Z) 248 + - `5`: South ascending (going up towards +Z) 249 + 250 + - `P`: Powered state 251 + - `0`: Unpowered 252 + - `1`: Powered 253 + 254 + ### Examples: 255 + 256 + - `0 (0000)`: North-South straight, unpowered 257 + - `1 (0001)`: East-West straight, unpowered 258 + - `8 (1000)`: North-South straight, powered 259 + - `10 (1010)`: East ascending, powered 260 + 261 + ## Detector Rail Metadata 262 + 263 + - Bit Usage: `A D D D` 264 + - Valid range: `0..13` 265 + 266 + ### Bit Definitions: 267 + 268 + - `DDD`: Direction/Shape 269 + - `0`: North-South straight 270 + - `1`: East-West straight 271 + - `2`: East ascending (going up towards +X) 272 + - `3`: West ascending (going up towards -X) 273 + - `4`: North ascending (going up towards -Z) 274 + - `5`: South ascending (going up towards +Z) 275 + 276 + - `A`: Active/Triggered state 277 + - `0`: No minecart detected 278 + - `1`: Minecart detected 279 + 280 + ### Examples: 281 + 282 + - `0 (0000)`: North-South straight, no minecart 283 + - `1 (0001)`: East-West straight, no minecart 284 + - `8 (1000)`: North-South straight, minecart detected (powering) 285 + - `10 (1010)`: East ascending, minecart detected (powering) 286 + 287 + ## Piston Head Metadata 288 + 289 + - Bit Usage: `S D D D` 290 + - Valid range:\*\* `0..13` 291 + 292 + ### Bit Definitions: 293 + 294 + - `DDD`: Facing direction 295 + - `0`: Down (Negative Y) 296 + - `1`: Up (Positive Y) 297 + - `2`: North (Negative Z) 298 + - `3`: South (Positive Z) 299 + - `4`: West (Negative X) 300 + - `5`: East (Positive X) 301 + 302 + - `S`: Is Sticky 303 + - `0`: Regular 304 + - `1`: Sticky 305 + 306 + ### Examples: 307 + 308 + - `0 (0000)`: Regular piston head facing down 309 + - `1 (0001)`: Regular piston head facing up 310 + - `8 (1000)`: Sticky piston head facing down 311 + - `13 (1101)`: Sticky piston head facing south 312 + 313 + ## Piston Metadata 314 + 315 + Piston is pretty much the same as its [Piston Head][piston_head] counterpart, 316 + just with different uses of the 3rd bit. 317 + 318 + - Bit Usage: `E D D D` 319 + - Valid range: `0..13` 320 + 321 + ### Bit Definitions: 322 + 323 + - `DDD`: Facing direction 324 + - `0`: Down (Negative Y) 325 + - `1`: Up (Positive Y) 326 + - `2`: North (Negative Z) 327 + - `3`: South (Positive Z) 328 + - `4`: West (Negative X) 329 + - `5`: East (Positive X) 330 + 331 + - `E`: Is Extended 332 + - `0`: Retracted 333 + - `1`: Extended 334 + 335 + ### Special Behaviors: 336 + 337 + - Note that stickiness is determined by block ID 338 + 339 + ### Examples: 340 + 341 + - `0 (0000)`: Facing down, retracted 342 + - `1 (0001)`: Facing up, retracted 343 + - `8 (1000)`: Facing down, extended 344 + - `11 (1011)`: Facing south, extended 345 + 346 + ## Torch Metadata 347 + 348 + - Bit Usage: `- A A A` 349 + - Valid range: `1..5` 350 + 351 + ### Bit Definitions: 352 + 353 + - `AAA`: Attachment direction 354 + - `1`: Attached to West face (pointing East) 355 + - `2`: Attached to East face (pointing West) 356 + - `3`: Attached to North face (pointing South) 357 + - `4`: Attached to South face (pointing North) 358 + - `5`: Standing on ground/block below 359 + 360 + ### Examples: 361 + 362 + - `1 (0001)`: Wall torch pointing East (attached to West wall) 363 + - `3 (0011)`: Wall torch pointing South (attached to North wall) 364 + - `5 (0101)`: Standing torch (on ground/block below) 365 + 366 + ## Fire Metadata 367 + 368 + - Bit Usage: `A A A A` 369 + - Valid range: `0..15` 370 + 371 + ### Bit Definitions: 372 + 373 + - `AAAA`: Age/Intensity level (4 bits) 374 + - `0`: Newly created fire 375 + - `1-14`: Aging fire 376 + - `15`: Maximum age (most likely to spread or die out) 377 + 378 + ### Special Behaviors: 379 + 380 + - Age increases by 0 or 1 each tick (randomly) 381 + - Death conditions: 382 + - Age > 3 and no solid block below = dies 383 + - Age = 15 and no flammable neighbors = may die randomly 384 + - Younger fires spread more aggressively 385 + 386 + ### Examples: 387 + 388 + - `0 (0000)`: Fresh fire just lit 389 + - `5 (0101)`: Moderate age fire 390 + - `15 (1111)`: Maximum age fire 391 + 392 + ## Stairs Metadata 393 + 394 + - Bit Usage: `- - D D` 395 + - Valid range: `0..3` 396 + 397 + ### Bit Definitions: 398 + 399 + - `DD`: Facing direction 400 + - `0`: Ascending East (facing West wall) 401 + - `1`: Ascending West (facing East wall) 402 + - `2`: Ascending South (facing North wall) 403 + - `3`: Ascending North (facing South wall) 404 + 405 + ### Examples: 406 + 407 + - `0 (0000)`: Stairs ascending toward East 408 + - `1 (0001)`: Stairs ascending toward West 409 + - `2 (0010)`: Stairs ascending toward South 410 + - `3 (0011)`: Stairs ascending toward North 411 + 412 + ## Redstone Wire Metadata 413 + 414 + - Bit Usage: `P P P P` 415 + - Valid range: `0..15` 416 + 417 + ### Bit Definitions: 418 + 419 + - `PPPP`: Power level 420 + - `0`: No power 421 + - `1-15`: Power strength (15 is maximum) 422 + 423 + ### Examples: 424 + 425 + - `0 (0000)`: Unpowered wire 426 + - `1 (0001)`: Weak power (far from source) 427 + - `15 (1111)`: Maximum power (at source or powered by strong source) 428 + 429 + ## Wheat Metadata 430 + 431 + - Bit Usage: `- G G G` 432 + - Valid range: `0..7` 433 + 434 + ### Bit Definitions: 435 + 436 + - `GGG`: Growth stage 437 + - `0`: Just planted (smallest) 438 + - `1-6`: Growing stages 439 + - `7`: Fully grown (ready to harvest) 440 + 441 + ### Examples: 442 + 443 + - `0 (0000)`: Newly planted wheat 444 + - `3 (0011)`: Half-grown wheat 445 + - `7 (0111)`: Fully mature wheat (harvestable) 446 + 447 + ## Farmland Metadata 448 + 449 + - Bit Usage: `- H H H` 450 + - Valid range: `0..7` 451 + 452 + ### Bit Definitions: 453 + 454 + - `HHH`: Hydration level 455 + - `0`: Dry farmland (will revert to dirt without crops nearby) 456 + - `1-6`: Partially hydrated 457 + - `7`: Fully hydrated (optimal for crop growth) 458 + 459 + ### Examples: 460 + 461 + - `0 (0000)`: Dry farmland 462 + - `4 (0100)`: Moderately hydrated farmland 463 + - `7 (0111)`: Fully hydrated farmland 464 + 465 + ## Furnace Metadata 466 + 467 + - Bit Usage: `- - D D` 468 + - Valid range: `2..5` 469 + 470 + ### Bit Definitions: 471 + 472 + - `DD`: Facing direction 473 + - `2`: North (Negative Z) 474 + - `3`: South (Positive Z) 475 + - `4`: West (Negative X) 476 + - `5`: East (Positive X) 477 + 478 + ### Special Behaviors: 479 + 480 + - Note that idle/active state is determined by block ID 481 + 482 + ### Examples: 483 + 484 + - `2 (0010)`: Furnace facing North 485 + - `3 (0011)`: Furnace facing South 486 + - `4 (0100)`: Furnace facing West 487 + - `5 (0101)`: Furnace facing East 488 + 489 + ## Standing Sign Metadata 490 + 491 + - Bit Usage: `D D D D` 492 + - Valid range: `0..15` 493 + 494 + ### Bit Definitions: 495 + 496 + - `DDDD`: Rotation direction 497 + - `0`: South 498 + - `1`: South-Southwest 499 + - `2`: Southwest 500 + - `3`: West-Southwest 501 + - `4`: West 502 + - `5`: West-Northwest 503 + - `6`: Northwest 504 + - `7`: North-Northwest 505 + - `8`: North 506 + - `9`: North-Northeast 507 + - `10`: Northeast 508 + - `11`: East-Northeast 509 + - `12`: East 510 + - `13`: East-Southeast 511 + - `14`: Southeast 512 + - `15`: South-Southeast 513 + 514 + ### Examples: 515 + 516 + - `0 (0000)`: Sign facing South 517 + - `4 (0100)`: Sign facing West 518 + - `8 (1000)`: Sign facing North 519 + - `12 (1100)`: Sign facing East 520 + 521 + ## Wall Sign Metadata 522 + 523 + - Bit Usage: `- - D D` 524 + - Valid range: `2..5` 525 + 526 + ### Bit Definitions: 527 + 528 + - `DD`: Attached wall direction 529 + - `2`: Attached to North wall (facing South) 530 + - `3`: Attached to South wall (facing North) 531 + - `4`: Attached to West wall (facing East) 532 + - `5`: Attached to East wall (facing West) 533 + 534 + ### Examples: 535 + 536 + - `2 (0010)`: Wall sign facing South (attached to North wall) 537 + - `3 (0011)`: Wall sign facing North (attached to South wall) 538 + - `4 (0100)`: Wall sign facing East (attached to West wall) 539 + - `5 (0101)`: Wall sign facing West (attached to East wall) 540 + 541 + ## Door Metadata 542 + 543 + - Bit Usage: `T O F F` 544 + - Valid range: `0..15` 545 + 546 + ### Bit Definitions: 547 + 548 + - `FF`: Facing direction 549 + - `0`: North (Negative Z) 550 + - `1`: East (Positive X) 551 + - `2`: South (Positive Z) 552 + - `3`: West (Negative X) 553 + 554 + - `O`: Is Open 555 + - `0`: Closed 556 + - `1`: Open 557 + 558 + - `T`: Half 559 + - `0`: Bottom half of door 560 + - `1`: Top half of door 561 + 562 + ### Examples: 563 + 564 + - `0 (0000)`: Bottom half, closed, facing North 565 + - `4 (0100)`: Bottom half, open, facing North 566 + - `8 (1000)`: Top half, closed, facing North 567 + - `12 (1100)`: Top half, open, facing North 568 + 569 + ## Ladder Metadata 570 + 571 + - Bit Usage: `- - D D` 572 + - Valid range: `2..5` 573 + 574 + ### Bit Definitions: 575 + 576 + - `DD`: Attached wall direction 577 + - `2`: Attached to South wall (facing North) 578 + - `3`: Attached to North wall (facing South) 579 + - `4`: Attached to East wall (facing West) 580 + - `5`: Attached to West wall (facing East) 581 + 582 + ### Examples: 583 + 584 + - `2 (0010)`: Ladder on South wall (climb facing North) 585 + - `3 (0011)`: Ladder on North wall (climb facing South) 586 + - `4 (0100)`: Ladder on East wall (climb facing West) 587 + - `5 (0101)`: Ladder on West wall (climb facing East) 588 + 589 + ## Lever Metadata 590 + 591 + - Bit Usage: `A A A A` 592 + - Valid range: `1..14` 593 + 594 + ### Bit Definitions: 595 + 596 + - `AAA`: Attachment orientation 597 + - `1`: Attached to West wall (lever points East) 598 + - `2`: Attached to East wall (lever points West) 599 + - `3`: Attached to North wall (lever points South) 600 + - `4`: Attached to South wall (lever points North) 601 + - `5`: On ground/ceiling (random orientation) 602 + - `6`: On ground/ceiling (alternate orientation) 603 + 604 + - `A`:` Is Activated 605 + - `0`: Lever off 606 + - `1`: Lever on 607 + 608 + ### Examples: 609 + 610 + - `1 (0001)`: Wall lever off, pointing East 611 + - `9 (1001)`: Wall lever on, pointing East 612 + - `5 (0101)`: Ground lever off 613 + - `13 (1101)`: Ground lever on 614 + 615 + ## Pressure Plate Metadata 616 + 617 + - Bit Usage: `- - - A` 618 + - Valid range: `0..1` 619 + 620 + ### Bit Definitions: 621 + 622 + - `A`: Activation state 623 + - `0`: Not pressed 624 + - `1`: Pressed 625 + 626 + ### Examples: 627 + 628 + - `0 (0000)`: Pressure plate not pressed 629 + - `1 (0001)`: Pressure plate pressed (providing power) 630 + 631 + ## Redstone Torch Metadata 632 + 633 + - Bit Usage: `- A A A` 634 + - Valid range: `1..5` 635 + 636 + ### Bit Definitions: 637 + 638 + - `AAA`: Attachment direction 639 + - `1`: Attached to West face (pointing East) 640 + - `2`: Attached to East face (pointing West) 641 + - `3`: Attached to North face (pointing South) 642 + - `4`: Attached to South face (pointing North) 643 + - `5`: Standing on ground/block below 644 + 645 + ### Special Behaviors: 646 + 647 + - Note that on/off state is determined by block ID 648 + 649 + ### Examples: 650 + 651 + - `1 (0001)`: Redstone torch pointing East (attached to West wall) 652 + - `3 (0011)`: Redstone torch pointing South (attached to North wall) 653 + - `5 (0101)`: Standing redstone torch (on ground/block below) 654 + 655 + ## Snow Layer Metadata 656 + 657 + - Bit Usage: `- D D D` 658 + - Valid range: `0..7` 659 + 660 + ### Bit Definitions: 661 + 662 + - `DDD`: Snow depth/thickness 663 + - `0`: 1 layer thick (2/16 blocks high) 664 + - `1`: 2 layers thick (4/16 blocks high) 665 + - `2`: 3 layers thick (6/16 blocks high) 666 + - `3`: 4 layers thick (0.5 blocks high, starts having collision) 667 + - `4`: 5 layers thick (10/16 blocks high) 668 + - `5`: 6 layers thick (12/16 blocks high) 669 + - `6`: 7 layers thick (14/16 blocks high) 670 + - `7`: 8 layers thick (1 block high) 671 + 672 + ### Examples: 673 + 674 + - `0 (0000)`: Thin snow layer (2/16 block high) 675 + - `3 (0011)`: Half-block snow (8/16 block high, has collision) 676 + - `7 (0111)`: Full-block snow (16/16 block high) 677 + 678 + ## Button Metadata 679 + 680 + - Bit Usage: `A D D D` 681 + - Valid range: `1..12` 682 + 683 + ### Bit Definitions: 684 + 685 + - `DDD`: Attached wall direction 686 + - `1`: Attached to West wall (button faces East) 687 + - `2`: Attached to East wall (button faces West) 688 + - `3`: Attached to North wall (button faces South) 689 + - `4`: Attached to South wall (button faces North) 690 + 691 + - `A`: Activated state 692 + - `0`: Button not pressed 693 + - `1`: Button pressed 694 + 695 + ### Examples: 696 + 697 + - `1 (0001)`: Button on West wall, not pressed 698 + - `9 (1001)`: Button on West wall, pressed (providing power) 699 + - `4 (0100)`: Button on South wall, not pressed 700 + - `12 (1100)`: Button on South wall, pressed (providing power) 701 + 702 + ## Pumpkin Metadata 703 + 704 + - Bit Usage: `- - D D` 705 + - Valid range: `0..3` 706 + 707 + ### Bit Definitions: 708 + 709 + - `DD`: Facing direction 710 + - `0`: South (Positive Z) 711 + - `1`: West (Negative X) 712 + - `2`: North (Negative Z) 713 + - `3`: East (Positive X) 714 + 715 + ### Examples: 716 + 717 + - `0 (0000)`: Pumpkin facing South 718 + - `1 (0001)`: Pumpkin facing West 719 + - `2 (0010)`: Pumpkin facing North 720 + - `3 (0011)`: Pumpkin facing East 721 + 722 + ## Cake Metadata 723 + 724 + - Bit Usage: `- B B B` 725 + - Valid range: `0..5` 726 + 727 + ### Bit Definitions: 728 + 729 + - `BBB`: Slices eaten 730 + - `0`: Whole cake 731 + - `1-5`: Number of slices eaten so far 732 + 733 + ### Examples: 734 + 735 + - `0 (0000)`: Full cake, uneaten 736 + - `3 (0011)`: 3 slices eaten (half cake left) 737 + - `5 (0101)`: 5 slices eaten (last visible slice) 738 + 739 + ## Redstone Repeater Metadata 740 + 741 + - Bit Usage: `D D F F` 742 + - Valid range: `0..15` 743 + 744 + ### Bit Definitions: 745 + 746 + - `FF`: Facing (output direction) 747 + - `0`: South (Positive Z) 748 + - `1`: West (Negative X) 749 + - `2`: North (Negative Z) 750 + - `3`: East (Positive X) 751 + 752 + - `DD`: Delay setting 753 + - `0`: 1 redstone tick (2 ticks) 754 + - `1`: 2 redstone ticks (4 ticks) 755 + - `2`: 3 redstone ticks (6 ticks) 756 + - `3`: 4 redstone ticks (8 ticks) 757 + 758 + ### Special Behaviors: 759 + 760 + - Note that powered/unpowered state is determined by block ID. 761 + 762 + ### Examples: 763 + 764 + - `0 (0000)`: Facing South, 1-tick delay 765 + - `5 (0101)`: Facing West, 2-tick delay 766 + - `10 (1010)`: Facing North, 3-tick delay 767 + - `15 (1111)`: Facing East, 4-tick delay 768 + 769 + ## Trapdoor Metadata 770 + 771 + - Bit Usage: `O D D` 772 + - Valid range: `0..7` 773 + 774 + ### Bit Definitions: 775 + 776 + - `DD`: Attached wall 777 + - `0`: Attached to South wall (block at +Z) 778 + - `1`: Attached to North wall (block at −Z) 779 + - `2`: Attached to East wall (block at +X) 780 + - `3`: Attached to West wall (block at −X) 781 + 782 + - `O`: Open state 783 + - `0`: Closed 784 + - `1`: Open 785 + 786 + ### Examples: 787 + 788 + - `0 (000)`: Closed, attached to South wall 789 + - `1 (001)`: Closed, attached to North wall 790 + - `4 (100)`: Open, attached to South wall 791 + - `7 (111)`: Open, attached to West wall 792 + 793 + [wheat]: #wheat-metadata 794 + [trapdoor]: #trapdoor-metadata 795 + [redstone_repeater]: #redstone-repeater-metadata 796 + [cake]: #cake-metadata 797 + [pumpkin]: #pumpkin-metadata 798 + [button]: #button-metadata 799 + [snow_layer]: #snow-layer-metadata 800 + [redstone_torch]: #redstone-torch-metadata 801 + [pressure_plate]: #pressure-plate-metadata 802 + [lever]: #lever-metadata 803 + [ladder]: #ladder-metadata 804 + [door]: #door-metadata 805 + [standing_sign]: #standing-sign-metadata 806 + [wall_sign]: #wall-sign-metadata 807 + [furnace]: #furnace-metadata 808 + [farmland]: #farmland-metadata 809 + [redstone_wire]: #redstone-wire-metadata 810 + [stairs]: #stairs-metadata 811 + [fire]: #fire-metadata 812 + [torch]: #torch-metadata 813 + [piston]: #piston-metadata 814 + [piston_head]: #piston-head-metadata 815 + [fluid]: #fluid-metadata 816 + [dispenser]: #dispenser-metadata 817 + [bed]: #bed-metadata 818 + [rail]: #rail-metadata 819 + [powered_rail]: #powered-rail-metadata 820 + [detector_rail]: #detector-rail-metadata
+179
docs/items.md
··· 1 + # Items 2 + 3 + For empty "data use", assume it to **always** be `0`. 4 + 5 + | Name | ID | Data Use | 6 + | ----------------------- | ---- | ---------------------- | 7 + | Iron Shovel | 256 | Damage | 8 + | Iron Pickaxe | 257 | Damage | 9 + | Iron Axe | 258 | Damage | 10 + | Flint and Steel | 259 | Damage | 11 + | Apple | 260 | | 12 + | Bow | 261 | | 13 + | Arrow | 262 | | 14 + | Coal | 263 | Type distinction: `0` | 15 + | Charcoal | 263 | Type distinction: `1` | 16 + | Diamond | 264 | | 17 + | Iron Ingot | 265 | | 18 + | Gold Ingot | 266 | | 19 + | Iron Sword | 267 | Damage | 20 + | Wooden Sword | 268 | Damage | 21 + | Wooden Shovel | 269 | Damage | 22 + | Wooden Pickaxe | 270 | Damage | 23 + | Wooden Axe | 271 | Damage | 24 + | Stone Sword | 272 | Damage | 25 + | Stone Shovel | 273 | Damage | 26 + | Stone Pickaxe | 274 | Damage | 27 + | Stone Axe | 275 | Damage | 28 + | Diamond Sword | 276 | Damage | 29 + | Diamond Shovel | 277 | Damage | 30 + | Diamond Pickaxe | 278 | Damage | 31 + | Diamond Axe | 279 | Damage | 32 + | Stick | 280 | | 33 + | Bowl | 281 | | 34 + | Mushroom Stew | 282 | | 35 + | Golden Sword | 283 | Damage | 36 + | Golden Shovel | 284 | Damage | 37 + | Golden Pickaxe | 285 | Damage | 38 + | Golden Axe | 286 | Damage | 39 + | String | 287 | | 40 + | Feather | 288 | | 41 + | Gunpowder | 289 | | 42 + | Wooden Hoe | 290 | Damage | 43 + | Stone Hoe | 291 | Damage | 44 + | Iron Hoe | 292 | Damage | 45 + | Golden Hoe | 293 | Damage | 46 + | Diamond Hoe | 294 | Damage | 47 + | Seeds | 295 | | 48 + | Wheat | 296 | | 49 + | Bread | 297 | | 50 + | Leather Helmet | 298 | Damage | 51 + | Leather Chestplate | 299 | Damage | 52 + | Leather Leggings | 300 | Damage | 53 + | Leather Boots | 301 | Damage | 54 + | Chainmail Helmet | 302 | Damage | 55 + | Chainmail Chestplate | 303 | Damage | 56 + | Chainmail Leggings | 304 | Damage | 57 + | Chainmail Boots | 305 | Damage | 58 + | Iron Helmet | 306 | Damage | 59 + | Iron Chestplate | 307 | Damage | 60 + | Iron Leggings | 308 | Damage | 61 + | Iron Boots | 309 | Damage | 62 + | Diamond Helmet | 310 | Damage | 63 + | Diamond Chestplate | 311 | Damage | 64 + | Diamond Leggings | 312 | Damage | 65 + | Diamond Boots | 313 | Damage | 66 + | Golden Helmet | 314 | Damage | 67 + | Golden Chestplate | 315 | Damage | 68 + | Golden Leggings | 316 | Damage | 69 + | Golden Boots | 317 | Damage | 70 + | Flint | 318 | | 71 + | Raw Porkchop | 319 | | 72 + | Cooked Porkchop | 320 | | 73 + | Painting | 321 | | 74 + | Golden Apple | 322 | | 75 + | Sign | 323 | | 76 + | Wooden Door | 324 | | 77 + | Bucket | 325 | | 78 + | Water Bucket | 326 | | 79 + | Lava Bucket | 327 | | 80 + | Minecart | 328 | | 81 + | Saddle | 329 | | 82 + | Iron Door | 330 | | 83 + | Redstone Dust | 331 | | 84 + | Snowball | 332 | | 85 + | Boat | 333 | | 86 + | Leather | 334 | | 87 + | Milk Bucket | 335 | | 88 + | Brick | 336 | | 89 + | Clay | 337 | | 90 + | Sugar Cane | 338 | | 91 + | Paper | 339 | | 92 + | Book | 340 | | 93 + | Slime Ball | 341 | | 94 + | Minecart with Chest | 342 | | 95 + | Minecart with Furnace | 343 | | 96 + | Egg | 344 | | 97 + | Compass | 345 | | 98 + | Fishing Rod | 346 | Damage | 99 + | Clock | 347 | | 100 + | Glowstone Dust | 348 | | 101 + | Raw Fish | 349 | | 102 + | Cooked Fish | 350 | | 103 + | Ink Sac | 351 | Type distinction: `0` | 104 + | Rose Red | 351 | Type distinction: `1` | 105 + | Cactus Green | 351 | Type distinction: `2` | 106 + | Cocoa Beans | 351 | Type distinction: `3` | 107 + | Lapis Lazuli | 351 | Type distinction: `4` | 108 + | Purple Dye | 351 | Type distinction: `5` | 109 + | Cyan Dye | 351 | Type distinction: `6` | 110 + | Light Gray (Silver) Dye | 351 | Type distinction: `7` | 111 + | Gray Dye | 351 | Type distinction: `8` | 112 + | Pink Dye | 351 | Type distinction: `9` | 113 + | Lime Dye | 351 | Type distinction: `10` | 114 + | Yellow Dye | 351 | Type distinction: `11` | 115 + | Light Blue Dye | 351 | Type distinction: `12` | 116 + | Magenta Dye | 351 | Type distinction: `13` | 117 + | Orange Dye | 351 | Type distinction: `14` | 118 + | Bone Meal | 351 | Type distinction: `15` | 119 + | Bone | 352 | | 120 + | Sugar | 353 | | 121 + | Cake | 354 | | 122 + | Bed | 355 | | 123 + | Redstone Repeater | 356 | | 124 + | Cookie | 357 | | 125 + | Map | 358 | Map ID | 126 + | Shears | 359 | Damage | 127 + | Music Disc 13 | 2256 | | 128 + | Music Disc Cat | 2257 | | 129 + 130 + ## Durability 131 + 132 + ### Tools 133 + 134 + - Wooden tools have a maximum usage of `59`. 135 + - Stone tools have a maximum usage of `131`. 136 + - Iron tools have a maximum usage of `250`. 137 + - Gold tools have a maximum usage of `32`. 138 + - Diamond tools have a maximum usage of `1561`. 139 + 140 + ### Armor 141 + 142 + - Helmets have a base maximum usage of `11`. 143 + - Chestplates have a base maximum usage of `16`. 144 + - Leggings have a base maximum usage of `15`. 145 + - Boots have a base maximum usage of `13`. 146 + 147 + The base usage is then multiplied based off the tier of material: 148 + 149 + - Leather: `3` 150 + - Chain: `6` 151 + - Gold: `6` 152 + - Iron: `12` 153 + - Diamond: `24` 154 + 155 + ### Other 156 + 157 + - Shears have a maximum usage of `238`. 158 + - Fishing rods have a maximum usage of `64`. 159 + - Flint and Steel has a maximum usage of `64`. 160 + 161 + ## Entity Damage 162 + 163 + - Swords have a base damage of `4`. 164 + - Axes have a base damage of `3`. 165 + - Pickaxes have a base damage of `2`. 166 + - Shovels have a base damage of `1`. 167 + 168 + The base damage is then added with a value based off the tier of material: 169 + 170 + - Wood: `0` 171 + - Stone: `1` 172 + - Iron: `2` 173 + - Gold: `0` 174 + - Diamond: `3` 175 + 176 + ### Swords 177 + 178 + The "material modifier" is multiplied by `2` before being added to the base 179 + damage.
+1410
docs/packets.md
··· 1 + # Packets <img src=".assets/cc-by-sa.png" alt="CC-BY-SA" width="88" height="31"> 2 + 3 + _This document is licensed under a [Creative Commons Attribution-ShareAlike 4.0 4 + license](https://creativecommons.org/licenses/by-sa/4.0/). Derivative works must 5 + be licensed using the same or a compatible license._ 6 + 7 + All packets begin with a single "Packet ID" byte. Listed packet size **does not 8 + include** this byte. Packets are either Clientbound, Serverbound, or both. 9 + Packets that travel both Clientbound and Serverbound may reuse fields for 10 + different purposes. 11 + 12 + There is no "length" field; for variable length packets, you must parse to the 13 + end to determine the length. 14 + 15 + ## Data Types 16 + 17 + | | Size (bytes) | Range | Notes | 18 + | ----- | ------------ | ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | 19 + | i8 | 1 | -128 to 127 | | 20 + | u8 | 1 | 0 to 255 | | 21 + | i16 | 2 | -32768 to 32767 | | 22 + | i32 | 4 | -2147483648 to 2147483647 | | 23 + | i64 | 8 | -9223372036854775808 to 9223372036854775807 | | 24 + | f32 | 4 | See [here][java8spec_floating]. | Single-precision 32-bit IEEE754 floating point. | 25 + | f64 | 8 | See [here][java8spec_floating]. | Double-precision 64-bit IEEE754 floating point. | 26 + | str8 | >=2 | N/A | [Modified UTF-8][mutf8] string. Prefixed by an `i16` containing the length of the string **in bytes**. | 27 + | str16 | >=2 | Minimum length of `0`, maximum character length of `32767` | [UTF-16][utf16] string. Prefixed by an `i16` containing the length of the string **in characters**. | 28 + | bool | 1 | `0x00` (`false`) or `0x01` (`true`) | | 29 + 30 + There are also additional types being used: 31 + 32 + ### Entity types 33 + 34 + | ID | Entity | Category | LivingEntity | 35 + | --- | ------------- | ---------- | ------------ | 36 + | 1 | Item | Misc | ❌ | 37 + | 9 | Painting | Misc | ❌ | 38 + | 10 | Arrow | Projectile | ❌ | 39 + | 11 | Snowball | Projectile | ❌ | 40 + | 20 | Primed TNT | Misc | ❌ | 41 + | 21 | Falling Sand | Misc | ❌ | 42 + | 40 | Minecart | Vehicle | ❌ | 43 + | 41 | Boat | Vehicle | ❌ | 44 + | 50 | Creeper | Hostile | ✅ | 45 + | 51 | Skeleton | Hostile | ✅ | 46 + | 52 | Spider | Hostile | ✅ | 47 + | 53 | Giant | Hostile | ✅ | 48 + | 54 | Zombie | Hostile | ✅ | 49 + | 55 | Slime | Hostile | ✅ | 50 + | 56 | Ghast | Hostile | ✅ | 51 + | 57 | Zombie Pigman | Neutral | ✅ | 52 + | 90 | Pig | Passive | ✅ | 53 + | 91 | Sheep | Passive | ✅ | 54 + | 92 | Cow | Passive | ✅ | 55 + | 93 | Chicken | Passive | ✅ | 56 + | 94 | Squid | Passive | ✅ | 57 + | 95 | Wolf | Passive | ✅ | 58 + 59 + ### Entity Metadata 60 + 61 + Entity metadata has a quirky packing format. 62 + 63 + A metadata field is a byte. The top three bits of the byte, when masked off 64 + (`(byte & 224) >> 5`) and interpreted as a three-bit number from 0 to 7, 65 + indicate the type of the field. 66 + 67 + The lower five bits are unused. The type of the byte indicates the size and 68 + type of a payload which follows the initial byte of the field. 69 + 70 + The metadata format consists of at least one field, followed by either another 71 + field or the magic number `0x7F`. `0x7F` terminates a metadata stream. 72 + 73 + Thus, the example metadata stream `0x00 0x01 0x7f` is decoded as a field of 74 + type 0, id 0, with a payload of byte 0x00. 75 + 76 + | Field ID | Field Type | 77 + | -------- | ------------------------------------------- | 78 + | 0 | i8 | 79 + | 1 | i16 | 80 + | 2 | i32 | 81 + | 3 | f32 | 82 + | 4 | str16 (maximum character length of 64) | 83 + | 5 | ItemStack; `i16` ID, `i8` count, `i16` data | 84 + | 6 | Vector of `i32`, 3 long (x,y,z) | 85 + 86 + More information is available at [0x18 Spawn Living Entity][spawn_living_entity]. 87 + 88 + ### Packed f64 89 + 90 + Sent as an `i32` on the wire, but is actually an `f64`. 91 + 92 + Java: 93 + 94 + ```java 95 + public static int floorDouble(double aDouble) { 96 + int anInteger = (int)aDouble; 97 + return aDouble < (double)anInteger ? anInteger - 1 : anInteger; 98 + } 99 + ``` 100 + 101 + ### Packed Rotation 102 + 103 + Sent as an `i8` on the wire, but is actually an `f32`. 104 + 105 + Basically, takes a rotation in degrees (`0..360`) and maps it into `0..255`. 106 + 107 + Java: 108 + 109 + ```java 110 + public static byte packRotation(float rotation) { 111 + return (byte)((int)(rotation * 256.0F / 360.0F)) 112 + } 113 + ``` 114 + 115 + ### Packed Motion i8 116 + 117 + Sent as an `i8` on the wire, but is actually an `f64`. 118 + 119 + Basically, just multiply the value by `128` and turn it into a (signed) byte. 120 + 121 + Java: 122 + 123 + ```java 124 + public static byte packMotion(double motion) { 125 + return (byte)((int)(motion * 128.0D)) 126 + } 127 + ``` 128 + 129 + ### Packed Motion i16 130 + 131 + Sent as an `i16` on the wire, but is actually an `f64`. 132 + 133 + Basically, just multiply the value by `128` and turn it into a (signed) byte. 134 + 135 + Java: 136 + 137 + ```java 138 + public static byte packMotion(double motion) { 139 + return (byte)((int)(motion * 128.0D)) 140 + } 141 + ``` 142 + 143 + ## 0x00 Keep Alive 144 + 145 + - Clientbound: [x] 146 + - Serverbound: [ ] 147 + - Size: 0 148 + 149 + This packet must be sent to keep the connection alive. 150 + 151 + - Keep Alive has no payload. 152 + 153 + ## 0x01 Login Request 154 + 155 + - Clientbound: [x] 156 + - Serverbound: [x] 157 + - Size: 15 + length of strings 158 + 159 + ### Clientbound 160 + 161 + Sent by the server if it accepts the client's login request. If it didn't it 162 + will send a [Disconnect][disconnect] instead. 163 + 164 + | Field Name | Field Type | Example | Notes | 165 + | ---------- | ---------- | ------- | --------------------------------------------------------------------------- | 166 + | Entity ID | i32 | `14` | The protocol version of Beta 1.7 is 14 | 167 + | Unused | str16 | N/A | Unused by the client. Vanilla server sends an empty string | 168 + | Map Seed | i64 | `0` | Used by the client to determine its current biome, among a few other things | 169 + | Dimension | i8 | `0` | `-1` for the Nether, `0` for the Overworld | 170 + 171 + ### Serverbound 172 + 173 + Sent by the client after the handshake to finish logging in. 174 + 175 + | Field Name | Field Type | Example | Notes | 176 + | ---------------- | ---------- | ------------- | ------------------------------------------------------------------------------- | 177 + | Protocol version | i32 | `14` | The protocol version of Beta 1.7 is 14 | 178 + | Username | str16 | `kokiriglade` | The name of the player attempting to login. Max length of 16 | 179 + | Map Seed | i64 | `0` | Can be safely ignored by the server | 180 + | Dimension | i8 | `0` | `-1` for the Nether, `0` for the Overworld. Can be safely ignored by the server | 181 + 182 + ## 0x02 Handshake 183 + 184 + - Clientbound: [x] 185 + - Serverbound: [x] 186 + - Size: 2 + length of strings 187 + 188 + ### Clientbound 189 + 190 + | Field Name | Field Type | Example | Notes | 191 + | --------------- | ---------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | 192 + | Connection Hash | str16 | `2e66f1dc032ab5f0` | A unique, per-connection hash. The vanilla server sends a random `i64` stringified as a hexadecimal number. For offline-mode, the string is always a single `-` | 193 + 194 + ### Serverbound 195 + 196 + | Field Name | Field Type | Example | Notes | 197 + | ---------- | ---------- | ------------- | ---------------------------------------------------------------------------- | 198 + | Username | str16 | `kokiriglade` | The name of the player attempting to connect. Maximum character length of 16 | 199 + 200 + ## 0x03 Chat Message 201 + 202 + - Clientbound: [x] 203 + - Serverbound: [x] 204 + - Size: 2 + length of strings 205 + 206 + | Field Name | Field Type | Example | Notes | 207 + | ---------- | ---------- | ---------------------- | ----------------------------------------------------------------------------- | 208 + | Message | str16 | `<kokiriglade> Hello!` | The name of the player attempting to connect. Maximum character length of 119 | 209 + 210 + ## 0x04 Update Time 211 + 212 + - Clientbound: [x] 213 + - Serverbound: [ ] 214 + - Size: 8 215 + 216 + The time of day is based on `timestamp % 24000`, where: 217 + 218 + - 0 is sunrise 219 + - 6000 is noon 220 + - 12000 is sunset 221 + - 18000 is midnight 222 + 223 + | Field Name | Field Type | Example | Notes | 224 + | ---------- | ---------- | ------- | ----------------------- | 225 + | Time | i64 | | The world time in ticks | 226 + 227 + ## 0x05 Set Player Equipment 228 + 229 + - Clientbound: [x] 230 + - Serverbound: [ ] 231 + - Size: 10 232 + 233 + After each [player spawn][spawn_player], there will be five of these packets for 234 + the equipped item and armor. If there are changes in visible equipment, another 235 + one of these packets is sent. 236 + 237 + | Field Name | Field Type | Example | Notes | 238 + | ---------- | ---------- | ------- | ------------------------------------ | 239 + | Entity ID | i32 | | Player's entity ID | 240 + | Slot | i16 | `4` | Equipment slot. See below | 241 + | Item ID | i16 | `-1` | Equipped item (`-1` for aempty slot) | 242 + | Data | i16 | | Item data value | 243 + 244 + ### Equipment slots 245 + 246 + (These only apply to this packet) 247 + 248 + - `0`: Held item 249 + - `1`: Helmet 250 + - `2`: Chestpate 251 + - `3`: Leggings 252 + - `4`: Boots 253 + 254 + ## 0x06 Spawn Position 255 + 256 + - Clientbound: [x] 257 + - Serverbound: [ ] 258 + - Size: 12 259 + 260 + Sent after login to specify the coordinates of the spawn point (the location at 261 + which players spawn, and which the compass points to). 262 + 263 + It can be sent at any time to update the point compasses point to. 264 + 265 + | Field Name | Field Type | Example | Notes | 266 + | ---------- | ---------- | ------- | ---------------------------- | 267 + | X | i32 | `117` | Spawn X in block coordinates | 268 + | Y | i32 | `70` | Spawn Y in block coordinates | 269 + | Z | i32 | `-46` | Spawn Z in block coordinates | 270 + 271 + ## 0x07 Use Entity 272 + 273 + - Clientbound: [ ] 274 + - Serverbound: [x] 275 + - Size: 9 276 + 277 + Sent upon attacking or right clicking an entity. 278 + 279 + | Field Name | Field Type | Example | Notes | 280 + | ---------------- | ---------- | ------- | ----------------------------------------------------------------------- | 281 + | Entity ID | i32 | | Player's entity ID. Ignored by the server | 282 + | Target entity ID | i32 | | Entity ID of the entity being interacted with | 283 + | Left click | bool | `true` | `true` if the interaction was caused by a left click, `false` otherwise | 284 + 285 + ## 0x08 Update Health 286 + 287 + - Clientbound: [x] 288 + - Serverbound: [ ] 289 + - Size: 2 290 + 291 + | Field Name | Field Type | Example | Notes | 292 + | ---------- | ---------- | ------- | ---------------- | 293 + | Health | i16 | `20` | Half a heart = 1 | 294 + 295 + ## 0x09 Respawn 296 + 297 + - Clientbound: [X] 298 + - Serverbound: [X] 299 + - Size: 1 300 + 301 + Sent by the client when the player presses the "Respawn" button after dying. 302 + The server then teleports the player to the spawn point, and sends a respawn 303 + packet in response. The client will not leave the respawn screen until it 304 + receives a respawn packet. 305 + 306 + | Field Name | Field Type | Example | Notes | 307 + | ---------- | ---------- | ------- | ------------------------------------------------------------------------------- | 308 + | Dimension | i8 | `0` | `-1` for the Nether, `0` for the Overworld. Can be safely ignored by the server | 309 + 310 + ## 0x0A On Ground 311 + 312 + - Clientbound: [x] 313 + - Serverbound: [x] 314 + - Size: 1 315 + 316 + | Field Name | Field Type | Example | Notes | 317 + | ---------- | ---------- | ------- | -------------------------------------------------------- | 318 + | On Ground | bool | `true` | `true` if the player is on the ground, `false` otherwise | 319 + 320 + ## 0x0B Player Position 321 + 322 + - Clientbound: [x] 323 + - Serverbound: [x] 324 + - Size: 33 325 + 326 + Updates the player position on the server. If `(stance - y) < 0.1 || (stance - y) > 1.65` 327 + then the stance is illegal. 328 + 329 + If the distance between the last known position of 330 + the player and the new position set by this packet is greater than 100, then the 331 + movement is illegal. 332 + 333 + If the absolute number of `x` or `z` are set greater than `3.2E7` then the 334 + position is illegal. 335 + 336 + | Field Name | Field Type | Example | Notes | 337 + | ---------- | ---------- | --------- | ----------------------------------------------------------------------------- | 338 + | X | f64 | `102.809` | | 339 + | Y | f64 | `70.00` | | 340 + | Stance | f64 | `71.62` | Used to modify the players bounding box when going up stairs, crouching, etc. | 341 + | Z | f64 | `68.30` | | 342 + | On Ground | bool | `true` | `true` if the player is on the ground, `false` otherwise | 343 + 344 + ## 0x0C Player Look 345 + 346 + - Clientbound: [x] 347 + - Serverbound: [x] 348 + - Size: 9 349 + 350 + Updates the direction the player is looking in. 351 + 352 + Yaw is measured in degrees, and does not follow classical trigonometry rules. 353 + 354 + The unit circle of yaw on the xz-plane starts at (0, 1) and turns backwards 355 + towards (-1, 0), or in other words, it turns clockwise instead of 356 + counter-clockwise. Additionally, yaw is not clamped to between 0 and 360 357 + degrees; any number is valid, including negative numbers and numbers greater 358 + than 360. 359 + 360 + | Field Name | Field Type | Example | Notes | 361 + | ---------- | ---------- | ------- | -------------------------------------------------------- | 362 + | Yaw | f32 | `0.0` | Rotation on the X Axis, in degrees | 363 + | Pitch | f32 | `0.0` | Rotation on the Y axis, in degrees | 364 + | On Ground | bool | `true` | `true` if the player is on the ground, `false` otherwise | 365 + 366 + ## 0x0D Player Position and Look 367 + 368 + - Clientbound: [x] 369 + - Serverbound: [x] 370 + - Size: 41 371 + 372 + A combination of [Player Look][player_look] and [Player Position][player_position]. 373 + 374 + | Field Name | Field Type | Example | Notes | 375 + | ---------- | ---------- | --------- | ----------------------------------------------------------------------------- | 376 + | X | f64 | `102.809` | | 377 + | Y | f64 | `70.00` | | 378 + | Stance | f64 | `71.62` | Used to modify the players bounding box when going up stairs, crouching, etc. | 379 + | Z | f64 | `68.30` | | 380 + | Yaw | f32 | `0.0` | Rotation on the X Axis, in degrees | 381 + | Pitch | f32 | `0.0` | Rotation on the Y axis, in degrees | 382 + | On Ground | bool | `true` | `true` if the player is on the ground, `false` otherwise | 383 + 384 + ## 0x0E Block Dig 385 + 386 + - Clientbound: [ ] 387 + - Serverbound: [x] 388 + - Size: 11 389 + 390 + Sent when the player is digging a block. 391 + 392 + | Field Name | Field Type | Example | Notes | 393 + | ---------- | ---------- | ------- | ------------------------------------------------------------- | 394 + | Status | i8 | `1` | The action the player is taking against the block (see below) | 395 + | X | i32 | `32` | Block position | 396 + | Y | i8 | `64` | Block position | 397 + | Z | i32 | `32` | Block position | 398 + | Face | i8 | `3` | The face being hit (see below) | 399 + 400 + ### Status 401 + 402 + Status can be: 403 + 404 + - `0`: Started digging 405 + - `2`: Finished digging 406 + - `4`: Drop item 407 + 408 + ### Special cases 409 + 410 + For some unthinkable reason, when the player drops an item, it sends this packet 411 + but the status is `4`, and all other values are `0`. 412 + 413 + ### Face 414 + 415 + Face can be: 416 + 417 + - `0`: Negative Y 418 + - `1`: Positive Y 419 + - `2`: Negative Z 420 + - `3`: Positive Z 421 + - `4`: Negative X 422 + - `5`: Positive X 423 + 424 + ## 0x0F Block Interact 425 + 426 + - Clientbound: [ ] 427 + - Serverbound: [x] 428 + - Size: 12 or 15 429 + 430 + Sent when the player places a block or (probably) an item. The coordinates sent 431 + in this packet are actually the block being built against, which combined with 432 + the direction offset tell you where the block should be placed. This is 433 + required to correctly position furnaces, torches, etc. 434 + 435 + | Field Name | Field Type | Example | Notes | 436 + | ---------------- | ------------- | ------- | ---------------------------------------------------------- | 437 + | X | i32 | `32` | Block position | 438 + | Y | i8 | `64` | Block position | 439 + | Z | i32 | `32` | Block position | 440 + | Face | i8 | `3` | The face being placed against (see [Block Dig][block_dig]) | 441 + | Block or Item ID | i16 | `1` | The block or item to be placed | 442 + | Count | Optional<i8> | `34` | The count of the itemstack in the players hand | 443 + | Data | Optional<i16> | `83` | The data value of the itemstack | 444 + 445 + If the Block/ItemID field is greater than or equal to 0, then the last 446 + 2 fields (count and data) are read. Otherwise, they are not read. 447 + 448 + When 'placing' (Or more accurately, using) your empty hand, the client sends -1 449 + as the Block/Item ID. 450 + 451 + ### Special cases 452 + 453 + This packet has a special case where X, Y, Z, and Direction are all -1. 454 + This special packet indicates that the currently held item for the player should 455 + have its state updated such as eating food, shooting bows, using buckets, etc. 456 + 457 + When using buckets, the client might send two packets: first a normal and then a 458 + special case. The first normal packet is sent when you're looking at a block 459 + (e.g. the water you want to scoop up). This normal packet does not appear to do 460 + anything with a Vanilla server. The second, special case packet appears to 461 + perform the action - based on current position/orientation and with a distance 462 + check - it appears that buckets can only be used within a radius of 6 blocks. 463 + 464 + ## 0x10 Change Current Slot 465 + 466 + - Clientbound: [ ] 467 + - Serverbound: [x] 468 + - Size: 2 469 + 470 + Sent when the player changes their current/active slot. 471 + 472 + | Field Name | Field Type | Example | Notes | 473 + | ---------- | ---------- | ------- | --------------------------------- | 474 + | Slot ID | i16 | `1` | Valid values are 0..8 (inclusive) | 475 + 476 + ## 0x11 Sleep 477 + 478 + - Clientbound: [x] 479 + - Serverbound: [ ] 480 + - Size: 14 481 + 482 + Sent to indicate a player is sleeping in a bed. 483 + 484 + | Field Name | Field Type | Example | Notes | 485 + | ---------- | ---------- | ------- | ------------------ | 486 + | Entity ID | i32 | `89` | Player's entity ID | 487 + | Unknown | i8 | `0` | Always 0, unused | 488 + | X | i32 | `-247` | Block coordinate | 489 + | Y | i8 | `78` | Block coordinate | 490 + | Z | i32 | `128` | Block coordinate | 491 + 492 + ## 0x12 Animation 493 + 494 + - Clientbound: [x] 495 + - Serverbound: [x] 496 + - Size: 5 497 + 498 + | Field Name | Field Type | Example | Notes | 499 + | ---------- | ---------- | ------- | ------------------ | 500 + | Entity ID | i32 | `55534` | Player's entity ID | 501 + | Animate | i8 | `1` | See below | 502 + 503 + ### Animate 504 + 505 + Animate can be: 506 + 507 + - `0`: No animation 508 + - `1`: Swing arm 509 + - `2`: Damage animation 510 + - `3`: Leave bed 511 + 512 + ## 0x13 Player Action 513 + 514 + - Clientbound: [ ] 515 + - Serverbound: [x] 516 + - Size: 5 517 + 518 + Sent when crouching and leaving a bed. 519 + 520 + | Field Name | Field Type | Example | Notes | 521 + | ---------- | ---------- | ------- | ------------------ | 522 + | Entity ID | i32 | `55534` | Player's entity ID | 523 + | Action | i8 | `1` | See below | 524 + 525 + ### Action 526 + 527 + Action can be: 528 + 529 + - `1`: Start crouching 530 + - `2`: Stop crouching 531 + - `3`: Leave bed 532 + 533 + ## 0x14 Spawn Player 534 + 535 + - Clientbound: [x] 536 + - Serverbound: [ ] 537 + - Size: 22 + length of strings 538 + 539 + Sent when a player comes into visible range. The vanilla client is not okay 540 + with receiving player entity packets that refer to its own username or EID; it 541 + will teleport to the absolute origin of the map and fall through the void any 542 + time it receives them. 543 + 544 + | Field Name | Field Type | Example | Notes | 545 + | ---------- | ---------- | ------------- | --------------------------------------------------------------------- | 546 + | Entity ID | i32 | `94453` | Player's entity ID | 547 + | Name | str16 | `kokiriglade` | Maximum character length of 16 | 548 + | X | i32 | `102.809` | [Packed f64][packed_f64] | 549 + | Y | i32 | `70.00` | [Packed f64][packed_f64] | 550 + | Z | i32 | `68.30` | [Packed f64][packed_f64] | 551 + | Yaw | i8 | `0.0` | [Packed rotation][packed_rotation] | 552 + | Pitch | i8 | `0.0` | [Packed rotation][packed_rotation] | 553 + | Held Item | i16 | `0` | The item the player is holding. `0` for no item. Must not be negative | 554 + 555 + ## 0x15 Spawn Item 556 + 557 + - Clientbound: [x] 558 + - Serverbound: [ ] 559 + - Size: 24 560 + 561 + Sent when a thrown item comes into range of the player. 562 + 563 + | Field Name | Field Type | Example | Notes | 564 + | ---------- | ---------- | --------- | ------------------------------------ | 565 + | Entity ID | i32 | `157617` | Item's entity ID | 566 + | Item ID | i16 | `4` | | 567 + | Count | i8 | `1` | The count of the itemstack | 568 + | Data | i16 | Item data | | 569 + | X | i32 | `102.809` | [Packed f64][packed_f64] | 570 + | Y | i32 | `70.00` | [Packed f64][packed_f64] | 571 + | Z | i32 | `68.30` | [Packed f64][packed_f64] | 572 + | Motion X | i8 | `0.0` | [Packed motion-i8][packed_motion_i8] | 573 + | Motion Y | i8 | `0.0` | [Packed motion-i8][packed_motion_i8] | 574 + | Motion Z | i8 | `0.0` | [Packed motion-i8][packed_motion_i8] | 575 + 576 + ## 0x16 Pickup Item 577 + 578 + - Clientbound: [x] 579 + - Serverbound: [ ] 580 + - Size: 8 581 + 582 + Sent when someone picks up an item lying on the ground - its sole purpose is 583 + the animation of the item flying towards the player. 584 + 585 + It doesn't destroy the entity in the client memory ([Destroy Entity][destroy_entity] 586 + does that), and it doesn't add it to the player's inventory ([Set Slot][set_slot] 587 + does that). 588 + 589 + The server only checks for items to be picked up after each [Player Position][player_position] 590 + and [Player Position and Look][player_position_and_look] packet sent by the client. 591 + 592 + | Field Name | Field Type | Example | Notes | 593 + | ------------------- | ---------- | ------- | -------------------------- | 594 + | Collected Entity ID | i32 | `28` | Collected item's entity ID | 595 + | Collector Entity ID | i32 | `30` | Collector's entity ID | 596 + 597 + ## 0x17 Spawn Non-Living Entity 598 + 599 + - Clientbound: [x] 600 + - Serverbound: [ ] 601 + - Size: 21 or 27 602 + 603 + Sent when a Non-Living entity is created. 604 + 605 + | Field Name | Field Type | Example | Notes | 606 + | ----------- | ---------- | ------- | ---------------------------------------------------------------- | 607 + | Entity ID | i32 | `62` | | 608 + | Entity Type | i8 | `11` | [See Entity Types][entity_types] (must be of kind `Living`) | 609 + | X | i32 | `16080` | [Packed f64][packed_f64] | 610 + | Y | i32 | `2290` | [Packed f64][packed_f64] | 611 + | Z | i32 | `592` | [Packed f64][packed_f64] | 612 + | Has Motion | i32 | `0` | If this flag is bigger than 0 then the following fields are sent | 613 + | Motion X | i16 | `0` | [Packed motion-i16][packed_motion_i16] | 614 + | Motion Y | i16 | `0` | [Packed motion-i16][packed_motion_i16] | 615 + | Motion Z | i16 | `0` | [Packed motion-i16][packed_motion_i16] | 616 + 617 + ## 0x18 Spawn Living Entity 618 + 619 + - Clientbound: [x] 620 + - Serverbound: [ ] 621 + - Size: 19 + [Metadata][entity_metadata] (at least 1) 622 + 623 + Sent when a Living Entity is created. 624 + 625 + | Field Name | Field Type | Example | Notes | 626 + | ------------------ | ---------------------------------- | ------- | -------------------------------------------------- | 627 + | Entity ID | i32 | `62` | | 628 + | Living Entity Type | i8 | `11` | See below | 629 + | X | i32 | `16080` | [Packed f64][packed_f64] | 630 + | Y | i32 | `2290` | [Packed f64][packed_f64] | 631 + | Z | i32 | `592` | [Packed f64][packed_f64] | 632 + | Yaw | i8 | `-27` | [Packed rotation][packed_rotation] | 633 + | Pitch | i8 | `0` | [Packed rotation][packed_rotation] | 634 + | Entity Metadata | [Entity Metadata][entity_metadata] | `127` | Indexed metadata, terminated by `0x7F` - see below | 635 + 636 + ### Living Entity types 637 + 638 + - `50`: Creeper 639 + - Index 16 is `i8`, for `fuse` 640 + - `1` for blowing up, `-1` otherwise 641 + - Index 17 is `bool`, for `is charged` 642 + - `51`: Skeleton 643 + - `52`: Spider 644 + - `53`: Giant Zombie 645 + - `54`: Zombie 646 + - `55`: Slime 647 + - Index 16 is `i8`, for `size` 648 + - `56`: Ghast 649 + - Index 16 is `i8`, for `is attacking` 650 + - `57`: Zombie Pigman 651 + - `90`: Pig 652 + - Index 16 is `i8`, for `is saddled` 653 + - `91`: Sheep 654 + - Index 16 is `i8` for `coat` 655 + - You can use a `0x10` bit mask for `shearedness` and `0x0F` for `color` - see below 656 + - `92`: Cow 657 + - `93`: Chicken 658 + - `94`: Squid 659 + - `95`: Wolf 660 + - Index 16 is `i8`, and is a bitmask: 661 + - `0x01` for `is sitting` 662 + - `0x02` for `is aggressive` 663 + - `0x04` for `is tamed` 664 + - Index 17 is `string16`, and is the `name of the player` who tamed the wolf 665 + - Index 18 is `i32`, and is the `health` of the wolf 666 + 667 + Metadata index 0 is an `i8` representing a set of 8 `bool`s: 668 + 669 + - `0x01`: On fire 670 + - `0x02`: Is crouched 671 + - `0x04`: Is riding 672 + 673 + ### Sheep colors 674 + 675 + - `0`: White 676 + - `1`: Orange 677 + - `2`: Magenta 678 + - `3`: Light Blue 679 + - `4`: Yellow 680 + - `5`: Lime 681 + - `6`: Pink 682 + - `7`: Gray 683 + - `8`: Light Gray (Silver) 684 + - `9`: Cyan 685 + - `10`: Purple 686 + - `11`: Blue 687 + - `12`: Brown 688 + - `13`: Green 689 + - `14`: Red 690 + - `15`: Black 691 + 692 + ## 0x19 Spawn Painting 693 + 694 + - Clientbound: [x] 695 + - Serverbound: [ ] 696 + - Size: 22 + length of strings 697 + 698 + Sent when a painting is created. 699 + 700 + Calculating the center of an image: given a `(width x height)` grid of cells, 701 + with `(0, 0)` being the top left corner, the center is `(max(0, width / 2 - 1), height / 2)`. 702 + E.g: 703 + 704 + - 2x1 (1, 0) 705 + - 4x4 (1, 2) 706 + 707 + | Field Name | Field Type | Example | Notes | 708 + | ---------- | ---------- | ---------- | ---------------------------------------------------- | 709 + | Entity ID | i32 | `326` | | 710 + | Title | str16 | `Creepers` | Name of the painting. Maximum character length of 13 | 711 + | X | i32 | `50` | Center X coordinate | 712 + | Y | i32 | `66` | Center Y coordinate | 713 + | Z | i32 | `-50` | Center Z coordinate | 714 + | Direction | i32 | `0` | Direction the painting is facing, see below | 715 + 716 + ### Direction 717 + 718 + - `0`: Negative Z 719 + - `1`: Negative X 720 + - `2`: Positive Z 721 + - `3`: Positive X 722 + 723 + ## 0x1C Update Velocity 724 + 725 + - Clientbound: [x] 726 + - Serverbound: [ ] 727 + - Size: 10 728 + 729 + Velocity is believed to be in units of 1/32000 of a block per server tick 730 + (200ms); for example, `-1343` would move `(-1343 / 32000) = -0.04196875` blocks 731 + per tick (or `-0.20984375 blocks per second`). 732 + 733 + Each axis' velocity is capped between -0.9 and 0.9 blocks per tick (packet 734 + values -28800 to 28800). 735 + 736 + | Field Name | Field Type | Example | Notes | 737 + | ---------- | ---------- | ------- | ---------------------- | 738 + | Entity ID | i32 | `1805` | | 739 + | X | i16 | `-1343` | Velocity on the X axis | 740 + | Y | i16 | `0` | Velocity on the Y axis | 741 + | Z | i16 | `0` | Velocity on the Z axis | 742 + 743 + ## 0x1D Destroy Entity 744 + 745 + - Clientbound: [x] 746 + - Serverbound: [ ] 747 + - Size: 4 748 + 749 + | Field Name | Field Type | Example | Notes | 750 + | ---------- | ---------- | ------- | ----- | 751 + | Entity ID | i32 | `446` | | 752 + 753 + ## 0x1E Entity 754 + 755 + - Clientbound: [x] 756 + - Serverbound: [ ] 757 + - Size: 4 758 + 759 + Most entity-related packets are subclasses of this packet. When sent from the 760 + server to the client, it may initialize the entry. 761 + 762 + For player entities, either this packet or any move/look packet is sent several 763 + times per second. So the meaning of this packet is basically that the entity 764 + did not move/look since the last such packet. 765 + 766 + | Field Name | Field Type | Example | Notes | 767 + | ---------- | ---------- | ------- | ----- | 768 + | Entity ID | i32 | `446` | | 769 + 770 + ## 0x1F Entity Relative Move 771 + 772 + - Clientbound: [x] 773 + - Serverbound: [ ] 774 + - Size: 7 775 + 776 + | Field Name | Field Type | Example | Notes | 777 + | ---------- | ---------- | ------- | ----- | 778 + | Entity ID | i32 | `446` | | 779 + | Relative X | i8 | `1` | | 780 + | Relative Y | i8 | `-7` | | 781 + | Relative Z | i8 | `5` | | 782 + 783 + Solid documentation on what these relative coordinates actually are is kind of 784 + lacking - apologies. I'll figure it out eventually though. 785 + 786 + ## 0x20 Entity Look 787 + 788 + - Clientbound: [x] 789 + - Serverbound: [ ] 790 + - Size: 6 791 + 792 + This packet is sent by the server when an entity rotates. 793 + 794 + Example: `Yaw`=`64` means a 90 degree turn. 795 + 796 + | Field Name | Field Type | Example | Notes | 797 + | ---------- | ---------- | ------- | ---------------------------------- | 798 + | Entity ID | i32 | `459` | | 799 + | Yaw | i8 | `64` | [Packed rotation][packed_rotation] | 800 + | Pitch | i8 | `0` | [Packed rotation][packed_rotation] | 801 + 802 + ## 0x21 Entity Look and Relative Move 803 + 804 + - Clientbound: [x] 805 + - Serverbound: [ ] 806 + - Size: 9 807 + 808 + This packet is sent by the server when an entity rotates and moves. 809 + 810 + Since `i8` range is limited from -128 to 127, this packet allows at most four b 811 + locks movement in any direction. (`-128/32 == -4`) 812 + 813 + | Field Name | Field Type | Example | Notes | 814 + | ---------- | ---------- | ------- | ------------------------------------ | 815 + | Entity ID | i32 | `446` | | 816 + | Relative X | i8 | `1` | | 817 + | Relative Y | i8 | `-7` | | 818 + | Relative Z | i8 | `5` | | 819 + | Yaw | i8 | `64` | X axis rotation as a fraction of 360 | 820 + | Pitch | i8 | `0` | Y axis rotation as a fraction of 360 | 821 + 822 + ## 0x22 Entity Teleport 823 + 824 + - Clientbound: [x] 825 + - Serverbound: [ ] 826 + - Size: 18 827 + 828 + This packet is sent by the server when an entity moves more than 4 blocks. 829 + 830 + | Field Name | Field Type | Example | Notes | 831 + | ---------- | ---------- | ------- | ---------------------------------- | 832 + | Entity ID | i32 | `446` | | 833 + | X | i32 | `14162` | [Packed f64][packed_f64] | 834 + | Y | i32 | `2176` | [Packed f64][packed_f64] | 835 + | Z | i32 | `1111` | [Packed f64][packed_f64] | 836 + | Yaw | i8 | `64` | [Packed rotation][packed_rotation] | 837 + | Pitch | i8 | `0` | [Packed rotation][packed_rotation] | 838 + 839 + ## 0x26 Entity Status 840 + 841 + - Clientbound: [x] 842 + - Serverbound: [ ] 843 + - Size: 5 844 + 845 + | Field Name | Field Type | Example | Notes | 846 + | ---------- | ---------- | ------- | --------- | 847 + | Entity ID | i32 | `446` | | 848 + | Status | i8 | `2` | See below | 849 + 850 + ### Status 851 + 852 + - `2`: (Living Entities only) Attack animation 853 + - `3`: (Living Entities only) Death animation 854 + - `6`: (Wolf only) Make smoke particles 855 + - `7`: (Wolf only) Make hearts particles 856 + - `8`: (Wolf only) Shaking 857 + 858 + ## 0x27 Ride Entity 859 + 860 + - Clientbound: [x] 861 + - Serverbound: [ ] 862 + - Size: 8 863 + 864 + This packet is sent when a player starts riding an entity. 865 + 866 + | Field Name | Field Type | Example | Notes | 867 + | ----------------- | ---------- | ------- | ------------------- | 868 + | Player Entity ID | i32 | `446` | Player's entity ID | 869 + | Vehicle Entity ID | i32 | `1805` | Vehicle's entity ID | 870 + 871 + ## 0x28 Update Entity Metadata 872 + 873 + - Clientbound: [x] 874 + - Serverbound: [ ] 875 + - Size: 4 + [Metadata][entity_metadata] (at least 1) 876 + 877 + | Field Name | Field Type | Example | Notes | 878 + | --------------- | ---------------------------------- | ------- | ------------------------------------------------- | 879 + | Entity ID | i32 | `446` | Entity ID | 880 + | Entity Metadata | [Entity Metadata][entity_metadata] | `127` | Indexed metadata, terminated by `0x7F` - see link | 881 + 882 + ## 0x32 Initialize Chunk 883 + 884 + - Clientbound: [x] 885 + - Serverbound: [ ] 886 + - Size: 9 887 + 888 + The client is expected to allocate space for a full chunk (16 x 128 x 16 blocks). 889 + 890 + One or more [Chunk Data][chunk_data] packets will follow, specifying actual data 891 + to fill the chunk with. 892 + 893 + Whenever you send this packet the client will clear any previous chunk at that 894 + spot if one has previously been sent. Clients don't like being in or next to an 895 + unloaded chunk, so try not to unload it if players are nearby. If the player 896 + appears to be twitching and stuck in place after joining the world, there is 897 + probably an unloaded chunk too close to them. 898 + 899 + | Field Name | Field Type | Example | Notes | 900 + | ----------- | ---------- | ------- | ------------------------------------------------------------------------------------- | 901 + | X | i32 | `-9` | Chunk coordinate | 902 + | Z | i32 | `12` | Chunk coordinate | 903 + | Load/Unload | bool | `true` | If `false`, the client unloads the chunk. If `true`, the client initializes the chunk | 904 + 905 + ## 0x33 Chunk Data 906 + 907 + - Clientbound: [x] 908 + - Serverbound: [ ] 909 + - Size: 17 + compressed chunk size 910 + 911 + | Field Name | Field Type | Example | Notes | 912 + | --------------- | ---------- | ------- | ------------------------------------- | 913 + | X | i32 | `128` | Block coordinate | 914 + | Y | i16 | `0` | Block coordinate | 915 + | Z | i32 | `-192` | Block coordinate | 916 + | Size X | i8 | `15` | Size X is Actual X Size -1 | 917 + | Size Y | i8 | `127` | Size Y is Actual Y Size -1 | 918 + | Size Z | i8 | `15` | Size Z is Actual Z Size -1 | 919 + | Compressed size | i32 | `3663` | Size of compressed region data | 920 + | Compressed data | Vec\<u8\> | `...` | Compressed region data (zlib deflate) | 921 + 922 + ### X,Y,Z 923 + 924 + This is the start position of the region, in world block coordinates. 925 + 926 + To find which chunk is affected, in the same coordinates given by [Initialize Chunk][initialize_chunk]: 927 + 928 + ``` 929 + chunkX = X >> 4 930 + chunkY = Y >> 7 931 + chunkZ = Z >> 4 932 + ``` 933 + 934 + And conversely, which local block in the chunk to start at: 935 + 936 + ``` 937 + startX = X & 15 938 + startY = Y & 127 (not always 0!) 939 + startZ = Z & 15 940 + ``` 941 + 942 + ### Size X,Y,Z 943 + 944 + This is the size of the region, in blocks. The server will subtract one from 945 + the sizes and then cast them to a byte before sending. This is so that chunks 946 + as large as 256 are possible. 947 + 948 + ### Compressed data 949 + 950 + The data is compressed using the deflate() function in [zlib]. After uncompressing, 951 + the data consists of four sequential sections, in order: 952 + 953 + - Block ID array (1 byte per block) 954 + - Block metadata array (half byte/nibble per block) 955 + - Block Light array (half byte/nibble per block) 956 + - Sky Light array (half byte/nibble per block) 957 + 958 + The data is exactly `(sizeX+1) * (sizeY+1) * (sizeZ+1) * 2.5` bytes long. 959 + Nibbles are not rounded either direction, which means that at least one 960 + dimension of the chunk must be even. 961 + 962 + The arrays are not interlaced. 963 + 964 + In other words, there are `sizeX` number of x planes, each plane made up of 965 + `sizeZ` number of z rows, each row made up of `sizeY` blocks indexed by y 966 + coordinate in order. 967 + 968 + The Block ID array is indexed with: 969 + 970 + ``` 971 + index = y + (z * (sizeY+1)) + (x * (sizeY+1) * (sizeZ+1)) 972 + ``` 973 + 974 + The other arrays are similar but you need to divide the index by two after 975 + calculating the above. Then each byte contains data for two blocks. The low 976 + four bits contain the first (lower Y) nibble and the high four bits contain the 977 + second nibble. 978 + 979 + If you have a FULL map chunk (`sizeX = 15, sizeY = 127, sizeZ = 15`), you can 980 + calculate index coordinates: 981 + 982 + ``` 983 + x = X + ( index >> 11 ) 984 + y = index & 0x7F 985 + z = Z + ( (index & 0x780) >> 7 ) 986 + ``` 987 + 988 + ## 0x34 Multi Block Change 989 + 990 + - Clientbound: [x] 991 + - Serverbound: [ ] 992 + - Size: 10 + arrays 993 + 994 + This is a multiple-block-change command; if you take the three arrays, and put 995 + together elements with the same index, and then decompose the `i16` into 996 + coordinates (top 4 bits is X, next 4 bits is Z, bottom 8 bits is Y), you get 997 + arrays like [((8, 7, 4), 11, 0), ((7, 13, 6), 11, 0), ((13, 1, 8), 11, 0), ((7, 6, 6), 11, 0)]. 998 + 999 + | Field Name | Field Type | Example | Notes | 1000 + | -------------------- | ---------- | ------- | --------------------------------------- | 1001 + | X | i32 | `-9` | Chunk coordinate | 1002 + | Z | i32 | `12` | Chunk coordinate | 1003 + | Array size | i16 | `2` | The total number of elements per array | 1004 + | Coordinate array | Vec\<i16\> | `...` | The coordinates of the blocks to change | 1005 + | Block ID array | Vec\<i8\> | `...` | The ID for each block to change | 1006 + | Block metadata array | Vec\<i8\> | `...` | The metadata for each block changed | 1007 + 1008 + See [blocks] for information on the metadata variable. 1009 + 1010 + ## 0x35 Block Change 1011 + 1012 + - Clientbound: [x] 1013 + - Serverbound: [ ] 1014 + - Size: 11 1015 + 1016 + | Field Name | Field Type | Example | Notes | 1017 + | -------------- | ---------- | ------- | -------------------------- | 1018 + | X | i32 | `128` | Block coordinate | 1019 + | Y | i8 | `0` | Block coordinate | 1020 + | Z | i32 | `-192` | Block coordinate | 1021 + | Block ID | i8 | `78` | The type for the block | 1022 + | Block metadata | i8 | `0` | The metadata for the block | 1023 + 1024 + See [blocks] for information on the metadata variable. 1025 + 1026 + ## 0x36 Play Note Block 1027 + 1028 + - Clientbound: [x] 1029 + - Serverbound: [ ] 1030 + - Size: 12 1031 + 1032 + Sent when a note block is played. 1033 + 1034 + | Field Name | Field Type | Example | Notes | 1035 + | --------------- | ---------- | ------- | ----------------------------------------------- | 1036 + | X | i32 | `128` | Block coordinate | 1037 + | Y | i16 | `0` | Block coordinate | 1038 + | Z | i32 | `-192` | Block coordinate | 1039 + | Instrument type | i8 | `3` | See below | 1040 + | Pitch | i8 | `17` | The pitch of the note (between 0..24 inclusive) | 1041 + 1042 + ### Instrument types 1043 + 1044 + - `0`: Harp 1045 + - `1`: Double Bass 1046 + - `2`: Snare Drum 1047 + - `3`: Clicks/Sticks (Hihat) 1048 + - `4`: Bass Drum 1049 + 1050 + ## 0x3C Explosion 1051 + 1052 + - Clientbound: [x] 1053 + - Serverbound: [ ] 1054 + - Size: 32 + `3*(coordinate count)` 1055 + 1056 + Sent when an explosion occurs. 1057 + 1058 + | Field Name | Field Type | Example | Notes | 1059 + | ---------------- | --------------------- | -------- | ------------------------------ | 1060 + | X | f64 | `128.0` | Center coordinate | 1061 + | Y | f64 | `0.0` | Center coordinate | 1062 + | Z | f64 | `-192.0` | Center coordinate | 1063 + | Radius | f32 | `4.0` | | 1064 + | Coordinate count | i32 | `60` | | 1065 + | Records | (i8, i8, i8) \* count | `...` | XYZ offsets of affected blocks | 1066 + 1067 + ## 0x3D Play Effect 1068 + 1069 + - Clientbound: [x] 1070 + - Serverbound: [ ] 1071 + - Size: 17 1072 + 1073 + Sent when a client is to play an effect. 1074 + 1075 + | Field Name | Field Type | Example | Notes | 1076 + | ---------- | ---------- | -------- | ---------------- | 1077 + | Effect ID | i32 | `1003` | See below | 1078 + | X | i32 | `128.0` | Block coordinate | 1079 + | Y | i8 | `0.0` | Block coordinate | 1080 + | Z | i32 | `-192.0` | Block coordinate | 1081 + | Data | i32 | `0` | See below | 1082 + 1083 + ### Effects 1084 + 1085 + - `1000`: Play sound `random.click` with pitch 1.0 1086 + - `1001`: Play sound `random.click` with pitch 1.2 1087 + - `1002`: Play sound `random.bow` with pitch 1.2 1088 + - `1003`: Play sound randomly between `random.door_open` and `random.door_close` with random uniform pitch between 0.0 and 1.0 1089 + - `1004`: Play sound `random.fizz` with volume 0.5 and random pitch 1090 + - `1005`: Play record sound. 1091 + - The record item ID is given in the effect data. 1092 + - `2000`: Spawn smoke particles 1093 + - The radius is given in effect data with two bits for X and Z axis, like this: `0bZZXX` 1094 + - `2001`: Play and show block break sound and particles. 1095 + - The block id is given in effect data. 1096 + 1097 + ## 0x46 Notification 1098 + 1099 + - Clientbound: [x] 1100 + - Serverbound: [ ] 1101 + - Size: 1 1102 + 1103 + Sent to notify the client of some state. 1104 + 1105 + | Field Name | Field Type | Example | Notes | 1106 + | ---------- | ---------- | ------- | --------- | 1107 + | Reason | i8 | `1` | See below | 1108 + 1109 + ### Reason 1110 + 1111 + - `0`: Invalid bed 1112 + - `1`: Start raining 1113 + - `2`: Stop raining 1114 + 1115 + ## 0x47 Lightning 1116 + 1117 + - Clientbound: [x] 1118 + - Serverbound: [ ] 1119 + - Size: 17 1120 + 1121 + Notifies the client of thunderbolts striking somewhere. The coordinates specify 1122 + where exactly the thunderbolt strikes. 1123 + 1124 + | Field Name | Field Type | Example | Notes | 1125 + | ---------- | ---------- | ------- | ------------------------ | 1126 + | Entity ID | i32 | `4` | Lightning bolt entity ID | 1127 + | ??? | bool | `true` | Always `true` | 1128 + | X | i32 | `133` | [Packed f64][packed_f64] | 1129 + | Y | i32 | `913` | [Packed f64][packed_f64] | 1130 + | Z | i32 | `63552` | [Packed f64][packed_f64] | 1131 + 1132 + ## 0x64 Open Inventory 1133 + 1134 + - Clientbound: [x] 1135 + - Serverbound: [ ] 1136 + - Size: 5 + length of strings 1137 + 1138 + | Field Name | Field Type | Example | Notes | 1139 + | --------------- | ---------- | ------- | -------------------- | 1140 + | Inventory ID | i8 | `123` | | 1141 + | Inventory Type | i8 | `0` | See below | 1142 + | Title | str8 | `Chest` | Only used for chests | 1143 + | Number of slots | i8 | `3` | | 1144 + 1145 + ### Inventory Type 1146 + 1147 + - `0`: Chest 1148 + - `1`: Crafting table 1149 + - `2`: Furnace 1150 + - `3`: Dispenser 1151 + 1152 + ## 0x65 Close Inventory 1153 + 1154 + - Clientbound: [x] 1155 + - Serverbound: [x] 1156 + - Size: 1 1157 + 1158 + Clients send this packet with Inventory ID `0` when they close their inventory. 1159 + 1160 + | Field Name | Field Type | Example | Notes | 1161 + | ------------ | ---------- | ------- | ------------------------ | 1162 + | Inventory ID | i8 | `123` | 0 for player's inventory | 1163 + 1164 + ## 0x66 Click Inventory 1165 + 1166 + - Clientbound: [ ] 1167 + - Serverbound: [x] 1168 + - Size: 9 or 12 1169 + 1170 + Sent when the playuer clicks on a slot in an inventory. 1171 + 1172 + | Field Name | Field Type | Example | Notes | 1173 + | -------------- | ---------- | ------- | ----------------------------------------------------------------------------------------------------- | 1174 + | Inventory ID | i8 | `123` | 0 for player's inventory | 1175 + | Cicked Slot | i16 | `36` | | 1176 + | Right clicking | bool | `true` | `true` if right cicking, `false` otherwise | 1177 + | Action number | `i16` | `12` | Unique number for the action, used for [transaction handling][transaction] | 1178 + | Shift | bool | `fase` | `true` if the player was holding shift, `false` otherwise | 1179 + | Item ID | `i16` | `3` | ID of the item that was in the slot. `-1` for no item. If `-1`, this is the last field in the packet. | 1180 + | Item Count | `i8` | `64` | | 1181 + | Item Data | `i16` | `10` | | 1182 + 1183 + When right-clicking on a stack of items, half the stack will be picked up and 1184 + half left in the slot. If the stack is an odd number, the half left in the slot 1185 + will be smaller of the amounts. 1186 + 1187 + The Action number is actually a counter, starting at `1`. This number is used by 1188 + the server as a transaction ID to send back a [transaction] packet. 1189 + 1190 + For help with slot IDs, see the next packet. 1191 + 1192 + ## 0x67 Set Inventory Slot 1193 + 1194 + - Clientbound: [x] 1195 + - Serverbound: [ ] 1196 + - Size: 5 or 8 1197 + 1198 + Sent by the server when an item in a slot is added/removed. 1199 + 1200 + | Field Name | Field Type | Example | Notes | 1201 + | ------------ | ---------- | ------- | ---------------------------------------------------------------- | 1202 + | Inventory ID | i8 | `123` | 0 for player's inventory | 1203 + | Slot | i16 | `36` | | 1204 + | Item ID | `i16` | `3` | `-1` for no item. If `-1`, this is the last field in the packet. | 1205 + | Item Count | `i8` | `64` | | 1206 + | Item Data | `i16` | `10` | | 1207 + 1208 + Note that if window ID and slot are both `-1`, it means the item currently attached to the cursor. 1209 + 1210 + ### Slot 1211 + 1212 + ![Minecraft inventory with slot IDs crudely labelled](.assets/slots.png) 1213 + 1214 + ## 0x68 Set Inventory Slots 1215 + 1216 + - Clientbound: [x] 1217 + - Serverbound: [ ] 1218 + - Size: 3 + size of payload 1219 + 1220 + Sent by the server when items in slots are added/removed. This includes the 1221 + player inventory, equipped armor, and crafting slots. 1222 + 1223 + | Field Name | Field Type | Example | Notes | 1224 + | ------------- | ---------- | ------- | ------------------------ | 1225 + | Inventory ID | i8 | `123` | 0 for player's inventory | 1226 + | Payload count | i16 | `4` | See below | 1227 + | Payload | ... | | See below | 1228 + 1229 + This packet is a bit trickier to parse than most others because the size of its 1230 + payload is variable. The payload is an array of shorts (item ID) optionally 1231 + followed by a byte-short pair (count and data) as long as the item ID does not 1232 + equal `-1`, which signifies an empty slot. 1233 + 1234 + ```python 1235 + offset = 0 1236 + 1237 + for slot in count: 1238 + item_id = payload[offset] as short 1239 + offset += 2 1240 + if item_id is not equal to -1: 1241 + count = payload[offset] as byte 1242 + offset += 1 1243 + uses = payload[offset] as short 1244 + offset += 2 1245 + inventory[slot] = new item(item_id, count, uses) 1246 + else: 1247 + inventory[slot] = None 1248 + ``` 1249 + 1250 + ## 0x69 Update Progress Bar 1251 + 1252 + - Clientbound: [x] 1253 + - Serverbound: [ ] 1254 + - Size: 5 1255 + 1256 + | Field Name | Field Type | Example | Notes | 1257 + | ------------ | ---------- | ------- | ------------------------ | 1258 + | Inventory ID | i8 | `123` | 0 for player's inventory | 1259 + | Progress Bar | i16 | `1` | See below | 1260 + | Value | i16 | 650 | See below | 1261 + 1262 + ### Furnace 1263 + 1264 + #### Progress bar 1265 + 1266 + - `0`: Arrow 1267 + - `1`: Fire 1268 + - `2`: Current Item Burn Time 1269 + - time in ticks that the fuel item takes to burn 1270 + 1271 + #### Value 1272 + 1273 + - `0`: Empty 1274 + - Full progress arrow: approx. `180` 1275 + - Full fire icon: approx. `250` 1276 + 1277 + ## 0x6A Transaction 1278 + 1279 + - Clientbound: [x] 1280 + - Serverbound: [x] 1281 + - Size: 4 1282 + 1283 + A packet from the server indicating whether a request from the client was 1284 + accepted, or whether there was a conflict (due to lag). This packet is also 1285 + sent from the client to the server in response to a server transaction rejection 1286 + packet. 1287 + 1288 + | Field Name | Field Type | Example | Notes | 1289 + | ------------- | ---------- | ------- | ------------------------ | 1290 + | Inventory ID | i8 | `123` | 0 for player's inventory | 1291 + | Action Number | i16 | `12` | | 1292 + | Accepted | bool | `true` | | 1293 + 1294 + ## 0x82 Update Sign 1295 + 1296 + - Clientbound: [x] 1297 + - Serverbound: [x] 1298 + - Size: 10 + length of strings 1299 + 1300 + This message is sent from the server to the client whenever a sign comes into 1301 + view distance or created. This message is sent from the client to the server when the "Done" 1302 + button is pressed after placing a sign. 1303 + 1304 + | Field Name | Field Type | Example | Notes | 1305 + | ---------- | ---------- | ------------- | ----- | 1306 + | X | i32 | `123` | | 1307 + | Y | i16 | `0` | | 1308 + | Z | i32 | `-128` | | 1309 + | Text1 | str16 | `First line` | | 1310 + | Text2 | str16 | `Second line` | | 1311 + | Text3 | str16 | `Third line` | | 1312 + | Text4 | str16 | `Fourth line` | | 1313 + 1314 + ## 0x83 Map Data 1315 + 1316 + - Clientbound: [x] 1317 + - Serverbound: [ ] 1318 + - Size: 5 + length of payload 1319 + 1320 + Sends map updates (columns of pixels or decorations). 1321 + 1322 + It allows the server to stream partial changes to a map rather than the entire 1323 + 128x128 bitmap. 1324 + 1325 + | Field Name | Field Type | Example | Notes | 1326 + | -------------- | ---------- | ------- | --------- | 1327 + | Item ID | i16 | `358` | | 1328 + | Item Data | i16 | `0` | | 1329 + | Payload length | u8 | `35` | | 1330 + | Payload | Vec\<i8\> | `...` | See below | 1331 + 1332 + ### Payload formats 1333 + 1334 + The first byte of the payload is a _tag_ indicating the type of update: 1335 + 1336 + #### Tag `0` (Column update) 1337 + 1338 + - `u8 x_start`: X coordinate (0..127) of the column. 1339 + - `u8 y_start`: Y coordinate (0..127) of the starting pixel. 1340 + - `Vec<u8> colors`: Palette indices (one per pixel) written _downwards_ starting at `(x_start, y_start)`. 1341 + 1342 + Each color is a raw color (0–255), not a limited palette enum. The raw value is 1343 + `base_id * 4 + shade`, where: 1344 + 1345 + - `base_id` is one of the 14 map palette entries. 1346 + - `shade` is 0..3 for brightness variation. 1347 + 1348 + #### Tag `1` (Decorations) 1349 + 1350 + Sequence of entries, each 3 bytes: 1351 + 1352 + - `u8 data`: Upper 4 bits = direction (0..15), lower 4 bits = type (always 0). 1353 + - `u8 x`: X coordinate of the decoration on the map (0..127). 1354 + - `u8 y`: Y coordinate of the decoration on the map (0..127). 1355 + 1356 + Decorations are only used to show the player cursors on the map in Beta 1.7. 1357 + 1358 + ## 0xC8 Increment Statistic 1359 + 1360 + - Clientbound: [x] 1361 + - Serverbound: [ ] 1362 + - Size: 5 1363 + 1364 + | Field Name | Field Type | Example | Notes | 1365 + | ------------ | ---------- | ------- | --------------------- | 1366 + | Statistic ID | i32 | `1003` | See below | 1367 + | Amount | i8 | `1` | Negative to decrement | 1368 + 1369 + ### Statistic ID 1370 + 1371 + - TODO :-( - but you can [try this forum post][statistics]? 1372 + 1373 + ## 0xFF Disconnect 1374 + 1375 + - Clientbound: [x] 1376 + - Serverbound: [x] 1377 + - Size: 2 + length of strings 1378 + 1379 + Sent by the server before it disconnects a client, or by the client before it 1380 + disconnects from the server. The receiver of this packet assumes that the 1381 + sender has already closed the connection by the time the packet arrives. 1382 + 1383 + | Field Name | Field Type | Example | Notes | 1384 + | ---------- | ---------- | --------------------- | ----- | 1385 + | Reason | str16 | `The server is full!` | | 1386 + 1387 + [blocks]: blocks.md 1388 + [entity_metadata]: #entity-metadata 1389 + [packed_f64]: #floored-double 1390 + [packed_rotation]: #packed-rotation 1391 + [packed_motion_i8]: #packed-motion-i8 1392 + [packed_motion_i16]: #packed-motion-i16 1393 + [entity_types]: #entity-types 1394 + [player_position]: #0x0b-player-position 1395 + [player_look]: #0x0c-player-look 1396 + [player_position_and_look]: #0x0d-player-position-and-look 1397 + [block_dig]: #0x0e-block-dig 1398 + [spawn_player]: #0x14-spawn-player 1399 + [spawn_living_entity]: #0x18-spawn-living-entity 1400 + [destroy_entity]: #0x1d-destroy-entity 1401 + [initialize_chunk]: #0x32-initialize-chunk 1402 + [chunk_data]: #0x33-chunk-data 1403 + [set_slot]: #0x67-set-slot 1404 + [transaction]: #0x6a-transaction 1405 + [disconnect]: #0xff-disconnect 1406 + [statistics]: http://www.minecraftforum.net/viewtopic.php?f=1020&t=295360 1407 + [zlib]: http://www.zlib.net/ 1408 + [java8spec_floating]: https://docs.oracle.com/javase/specs/jls/se9/html/jls-4.html#jls-4.2.3 1409 + [utf16]: https://en.wikipedia.org/wiki/UTF-16 1410 + [mutf8]: https://docs.oracle.com/javase/8/docs/api/java/io/DataInput.html#modified-utf-8