Entity metadata: Difference between revisions
imported>Libraryaddict No edit summary |
imported>Thinkofdeath (Added missing metadata indexes and cleaned up the whole page) |
||
| Line 1: | Line 1: | ||
== Entity Metadata Format == | == Mobs == | ||
Mobs are spawned via [[Protocol#0x18|0x18 Mob Spawn]] | |||
{| class="wikitable" | |||
|- | |||
! Type | |||
! Name | |||
! x, z | |||
! y | |||
|- | |||
| 50 | |||
| Creeper | |||
| 0.6 | |||
| 1.8 | |||
|- | |||
| 51 | |||
| Skeleton | |||
| 0.6 | |||
| 1.8 | |||
|- | |||
| 52 | |||
| Spider | |||
| 1.4 | |||
| 0.9 | |||
|- | |||
| 53 | |||
| Giant Zombie | |||
| 3.6 | |||
| 10.8 | |||
|- | |||
| 54 | |||
| Zombie | |||
| 0.6 | |||
| 1.8 | |||
|- | |||
| 55 | |||
| Slime | |||
| 0.6 * size | |||
| 0.6 * size | |||
|- | |||
| 56 | |||
| Ghast | |||
| 4 | |||
| 4 | |||
|- | |||
| 57 | |||
| Zombie Pigman | |||
| 0.6 | |||
| 1.8 | |||
|- | |||
| 58 | |||
| Enderman | |||
| | |||
| | |||
|- | |||
| 59 | |||
| Cave Spider | |||
| | |||
| | |||
|- | |||
| 60 | |||
| Silverfish | |||
| | |||
| | |||
|- | |||
| 61 | |||
| Blaze | |||
| | |||
| | |||
|- | |||
| 62 | |||
| Magma Cube | |||
| 0.6 * size | |||
| 0.6 * size | |||
|- | |||
| 63 | |||
| Ender Dragon | |||
| | |||
| | |||
|- | |||
| 64 | |||
| Wither | |||
| | |||
| | |||
|- | |||
| 65 | |||
| Bat | |||
| | |||
| | |||
|- | |||
| 66 | |||
| Witch | |||
| | |||
| | |||
|- | |||
| 90 | |||
| Pig | |||
| 0.9 | |||
| 0.9 | |||
|- | |||
| 91 | |||
| Sheep | |||
| 0.6 | |||
| 1.3 | |||
|- | |||
| 92 | |||
| Cow | |||
| 0.9 | |||
| 1.3 | |||
|- | |||
| 93 | |||
| Chicken | |||
| 0.3 | |||
| 0.4 | |||
|- | |||
| 94 | |||
| Squid | |||
| 0.95 | |||
| 0.95 | |||
|- | |||
| 95 | |||
| Wolf | |||
| 0.6 | |||
| 1.8 | |||
|- | |||
| 96 | |||
| Mooshroom | |||
| | |||
| | |||
|- | |||
| 97 | |||
| Snowman | |||
| | |||
| | |||
|- | |||
| 98 | |||
| Ocelot | |||
| | |||
| | |||
|- | |||
| 99 | |||
| Iron Golem | |||
| | |||
| | |||
|- | |||
| 100 | |||
| Horse | |||
| | |||
| | |||
|- | |||
| 120 | |||
| Villager | |||
| | |||
| | |||
|} | |||
== Objects == | |||
Objects are spawned via [[Protocol#0x17|0x17 Spawn Object/Vehicle]]. See [[Object Data]] for more details. | |||
{| class="wikitable" | |||
|- | |||
! ID | |||
! Name | |||
! x, z | |||
! y | |||
|- | |||
| 1 | |||
| Boat | |||
| 1.5 | |||
| 0.6 | |||
|- | |||
| 2 | |||
| Item Stack ([[Slot]]) | |||
| 0.5 | |||
| 0.5 | |||
|- | |||
| 10 | |||
| Minecart | |||
| 0.98 | |||
| 0.7 | |||
|- | |||
| 11 | |||
| Minecart (storage) | |||
| 0.98 | |||
| 0.7 | |||
|- | |||
| 12 | |||
| Minecart (powered) | |||
| 0.98 | |||
| 0.7 | |||
|- | |||
| 50 | |||
| Activated TNT | |||
| 0.98 | |||
| 0.98 | |||
|- | |||
| 51 | |||
| EnderCrystal | |||
| 1.25? | |||
| 2.25? | |||
|- | |||
| 60 | |||
| Arrow (projectile) | |||
| 0.5 | |||
| 0.5 | |||
|- | |||
| 61 | |||
| Snowball (projectile) | |||
| 0.25 | |||
| 0.25 | |||
|- | |||
| 62 | |||
| Egg (projectile) | |||
| 0.25 | |||
| 0.25 | |||
|- | |||
| 65 | |||
| Thrown Enderpearl | |||
| | |||
| | |||
|- | |||
| 66 | |||
| Wither Skull | |||
| | |||
| | |||
|- | |||
| 70 | |||
| Falling Objects | |||
| 0.98 | |||
| 0.98 | |||
|- | |||
| 71 | |||
| Item frames | |||
| ? | |||
| ? | |||
|- | |||
| 72 | |||
| Eye of Ender | |||
| | |||
| | |||
|- | |||
| 73 | |||
| Thrown Potion | |||
| | |||
| | |||
|- | |||
| 74 | |||
| Falling Dragon Egg | |||
| 0.98 | |||
| 0.98 | |||
|- | |||
| 75 | |||
| Thrown Exp Bottle | |||
| | |||
| | |||
|- | |||
| 90 | |||
| Fishing Float | |||
| 0.25? | |||
| 0.25? | |||
|} | |||
== Entity Metadata == | |||
=== Entity Metadata Format === | |||
Note that entity metadata is a totally distinct concept from block metadata. All entities '''must''' send at least one item of metadata, in most cases this will be the health item. | Note that entity metadata is a totally distinct concept from block metadata. All entities '''must''' send at least one item of metadata, in most cases this will be the health item. | ||
| Line 19: | Line 285: | ||
|- | |- | ||
| 0 | | 0 | ||
| | | Byte | ||
|- | |- | ||
| 1 | | 1 | ||
| | | Short | ||
|- | |- | ||
| 2 | | 2 | ||
| | | Int | ||
|- | |- | ||
| 3 | | 3 | ||
| | | Float | ||
|- | |- | ||
| 4 | | 4 | ||
| | | String16 | ||
|- | |- | ||
| 5 | | 5 | ||
| [[Slot Data| | | [[Slot Data|Slot]] | ||
|- | |- | ||
| 6 | | 6<sup>*</sup> | ||
| | | Int, Int, Int (x, y, z) | ||
|} | |} | ||
| Line 67: | Line 333: | ||
</source> | </source> | ||
=== Index | === Entity === | ||
{| class="wikitable" | |||
|- | |||
! style="width: 75px" | Index | |||
! style="width: 75px" | Type | |||
! style="width: 250px" colspan="2" | Meaning | |||
|- | |||
| rowspan="6" | 0 | |||
| rowspan="6" | Byte | |||
! Bit Mask !! Meaning | |||
|- | |||
| 0x01 || On Fire | |||
|- | |||
| 0x02 || Crouched | |||
|- | |||
| 0x08 || Sprinting | |||
|- | |||
| 0x10 || Eating/Drinking/Blocking | |||
|- | |||
| 0x20 || Invisible | |||
|- | |||
| 1 | |||
| Short | |||
| colspan="2" | Air | |||
|} | |||
=== Living Entity === | |||
<sup>Extends [[#Entity|Entity]]</sup> | |||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
! | ! style="width: 75px" | Index | ||
! | ! style="width: 75px" | Type | ||
! | ! style="width: 250px" | Meaning | ||
|- | |- | ||
| | | 6 | ||
| | | Float | ||
| | | Health | ||
|- | |- | ||
| | | 7 | ||
| | | Int | ||
| | | Potion Effect Color | ||
|- | |- | ||
| | | 8 | ||
| | | Byte | ||
| | | Is Potion Effect Ambient | ||
|- | |- | ||
| | | 9 | ||
| | | Byte | ||
| | | Number of Arrows in Entity | ||
|- | |- | ||
| | | 10 | ||
| | | String | ||
| | | Name Tag | ||
|- | |- | ||
| | | 11 | ||
| | | Byte | ||
| | | Always Show Name Tag | ||
|} | |} | ||
=== | === Ageable === | ||
<sup>Extends [[#Living Entity|Living Entity]]</sup> | |||
{| class="wikitable" | |||
|- | |||
! style="width: 75px" | Index | |||
! style="width: 75px" | Type | |||
! style="width: 250px" | Meaning | |||
|- | |||
| 12 | |||
| Int | |||
| Entity's Age (Negative = Child) | |||
|} | |||
=== Horse === | |||
<sup>Extends [[#Ageable|Ageable]]</sup> | |||
=== | {| class="wikitable" | ||
|- | |||
! style="width: 75px" | Index | |||
! style="width: 75px" | Type | |||
! style="width: 250px" colspan="3" | Meaning | |||
|- | |||
| rowspan="8" | 16 | |||
| rowspan="8" | Int | |||
! Bit Mask | |||
! colspan="2" | Meaning | |||
|- | |||
| 0x02 | |||
| colspan="2" | Is Tame | |||
|- | |||
| 0x04 | |||
| colspan="2" | Has Saddle | |||
|- | |||
| 0x08 | |||
| colspan="2" | Has Chest | |||
|- | |||
| 0x10 | |||
| colspan="2" | Is bred | |||
|- | |||
| 0x20 | |||
| colspan="2" | Is Eating | |||
|- | |||
| 0x40 | |||
| colspan="2" | Is Rearing | |||
|- | |||
| 0x80 | |||
| colspan="2" | Mouth Open | |||
|- | |||
| rowspan="6" | 19 | |||
| rowspan="6" | Byte | |||
! Value | |||
! colspan="2" | Type | |||
|- | |||
| 0 | |||
| colspan="2" | Horse | |||
|- | |||
| 1 | |||
| colspan="2" | Donkey | |||
|- | |||
| 2 | |||
| colspan="2" | Mule | |||
|- | |||
| 3 | |||
| colspan="2" | Zombie | |||
|- | |||
| 4 | |||
| colspan="2" | Skeleton | |||
|- | |||
| rowspan="15" | 20 | |||
| rowspan="15" | Int | |||
!Bit Mask | |||
! colspan="2" | Meaning | |||
|- | |||
| rowspan="8" | 0x00FF | |||
! Value !! Color | |||
|- | |||
| 0 || White | |||
|- | |||
| 1 || Creamy | |||
|- | |||
| 2 || Chestnut | |||
|- | |||
| 3 || Brown | |||
|- | |||
| 4 || Black | |||
|- | |||
| 5 || Gray | |||
|- | |||
| 6 || Dark Down | |||
|- | |||
| rowspan="6" | 0xFF00 | |||
! Value !! Style | |||
|- | |||
| 0 || None | |||
|- | |||
| 1 || White | |||
|- | |||
| 2 || Whitefield | |||
|- | |||
| 3 || White Dots | |||
|- | |||
| 4 || Black Dots | |||
|- | |||
| 21 | |||
| String | |||
| colspan="3" | Owner Name | |||
|- | |||
| rowspan="5" | 22 | |||
| rowspan="5" | Int | |||
! Value | |||
! colspan="2" | Type | |||
|- | |||
| 0 | |||
| colspan="2" | No Armor | |||
|- | |||
| 1 | |||
| colspan="2" | Iron Armor | |||
|- | |||
| 2 | |||
| colspan="2" | Gold Armor | |||
|- | |||
| 3 | |||
| colspan="2" | Diamond Armor | |||
|} | |||
=== Bat === | |||
<sup>Extends [[#Living Entity|Living Entity]]</sup> | |||
=== | {| class="wikitable" | ||
|- | |||
! style="width: 75px" | Index | |||
! style="width: 75px" | Type | |||
! style="width: 250px" | Meaning | |||
|- | |||
| 16 | |||
| Byte | |||
| Is Hanging | |||
|} | |||
=== Tameable === | |||
<sup>Extends [[#Ageable|Ageable]]</sup> | |||
{| class="wikitable" | |||
|- | |||
! style="width: 75px" | Index | |||
! style="width: 75px" | Type | |||
! style="width: 250px" colspan="2"| Meaning | |||
|- | |||
| rowspan="3" | 16 | |||
| rowspan="3" | Byte | |||
! Bit Mask !! Meaning | |||
|- | |||
| 0x01 || Is Sitting | |||
|- | |||
| 0x04 || Is Tame | |||
|- | |||
| 17 | |||
| String | |||
| colspan="2" | Owner Name | |||
|} | |||
=== Ocelot === | |||
<sup>Extends [[#Tameable|Tameable]]</sup> | |||
{| class="wikitable" | |||
|- | |||
! style="width: 75px" | Index | |||
! style="width: 75px" | Type | |||
! style="width: 250px" | Meaning | |||
|- | |||
| 18 | |||
| Byte | |||
| Ocelot Type | |||
|} | |||
=== Wolf === | |||
<sup>Extends [[#Tameable|Tameable]]</sup> | |||
=== | {| class="wikitable" | ||
|- | |||
! style="width: 75px" | Index | |||
! style="width: 75px" | Type | |||
! style="width: 250px" colspan="2"| Meaning | |||
|- | |||
| rowspan="3" | 16 | |||
| rowspan="3" | Byte | |||
!Bit Mask !! Meaning | |||
|- | |||
| colspan="2" | Flags from Tameable | |||
|- | |||
| 0x02 || Is Angry | |||
|- | |||
| 18 | |||
| Float | |||
| colspan="2" | Health | |||
|- | |||
| 19 | |||
| Byte | |||
| colspan="2" | Begging | |||
|- | |||
| 20 | |||
| Byte | |||
| colspan="2" | Collar Color | |||
|} | |||
=== | === Pig === | ||
<sup>Extends [[#Ageable|Ageable]]</sup> | |||
{| class="wikitable" | |||
|- | |||
! style="width: 75px" | Index | |||
! style="width: 75px" | Type | |||
! style="width: 250px" | Meaning | |||
|- | |||
| 16 | |||
| Byte | |||
| Has Saddle | |||
|} | |||
=== Sheep === | |||
<sup>Extends [[#Ageable|Ageable]]</sup> | |||
{| class="wikitable" | |||
|- | |||
! style="width: 75px" | Index | |||
! style="width: 75px" | Type | |||
! style="width: 250px" colspan="3"| Meaning | |||
|- | |||
| rowspan="19" | 16 | |||
| rowspan="19" | Byte | |||
! Bit Mask | |||
! colspan="2" | Meaning | |||
|- | |||
| rowspan="17" | 0x0F | |||
! Value !! Color | |||
|- | |||
| 0 || White | |||
|- | |||
| 1 || Orange | |||
|- | |||
| 2 || Magenta | |||
|- | |||
| 3 || Light Blue | |||
|- | |||
| 4 || Yellow | |||
|- | |||
| 5 || Lime | |||
|- | |||
| 6 || Pink | |||
|- | |||
| 7 || Gray | |||
|- | |||
| 8 || Silver | |||
|- | |||
| 9 || Cyan | |||
|- | |||
| 10 || Purple | |||
|- | |||
| 11 || Blue | |||
|- | |||
| 12 || Brown | |||
|- | |||
| 13 || Green | |||
|- | |||
| 14 || Red | |||
|- | |||
| 15 || Black | |||
|- | |||
| 0x10 | |||
| colspan="2" | Is Sheared | |||
|} | |||
== | === Villager === | ||
<sup>Extends [[#Ageable|Ageable]]</sup> | |||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
! | ! style="width: 75px" | Index | ||
! | ! style="width: 75px" | Type | ||
! | ! style="width: 250px" colspan="2" | Meaning | ||
|- | |||
|- | | rowspan="6" | 16 | ||
| | | rowspan="6" | Int | ||
! Value !! Profession | |||
|- | |||
| 0 || Farmer | |||
|- | |||
| 1 || Librarian | |||
| | |- | ||
| 2 || Priest | |||
|- | |||
| 3 || Blacksmith | |||
|- | |||
| 4 || Butcher | |||
|- | |||
| | |||
|- | |||
|- | |||
| | |||
|- | |||
| | |||
| | |||
|- | |||
| | |||
| | |||
|} | |} | ||
=== | === Enderman === | ||
<sup>Extends [[#Living Entity|Living Entity]]</sup> | |||
{| class="wikitable" | |||
|- | |||
! style="width: 75px" | Index | |||
! style="width: 75px" | Type | |||
! style="width: 250px" | Meaning | |||
|- | |||
| 16 | |||
| Byte | |||
| Carried Block | |||
|- | |||
| 17 | |||
| Byte | |||
| Carried Block Data | |||
|- | |||
| 18 | |||
| Byte | |||
| Is Screaming | |||
|} | |||
=== Zombie === | |||
<sup>Extends [[#Living Entity|Living Entity]]</sup> | |||
==== | {| class="wikitable" | ||
|- | |||
! style="width: 75px" | Index | |||
! style="width: 75px" | Type | |||
! style="width: 250px" | Meaning | |||
|- | |||
| 12 | |||
| Byte | |||
| Is Child | |||
|- | |||
| 13 | |||
| Byte | |||
| Is Villager | |||
|- | |||
| 14 | |||
| Byte | |||
| Is Converting | |||
|} | |||
=== Zombie Pigman === | |||
<sup>Extends [[#Zombie|Zombie]]</sup> | |||
=== Blaze === | |||
<sup>Extends [[#Living Entity|Living Entity]]</sup> | |||
==== | {| class="wikitable" | ||
|- | |||
! style="width: 75px" | Index | |||
! style="width: 75px" | Type | |||
! style="width: 250px" | Meaning | |||
|- | |||
| 16 | |||
| Byte | |||
| On Fire | |||
|} | |||
=== Spider === | |||
<sup>Extends [[#Living Entity|Living Entity]]</sup> | |||
==== | {| class="wikitable" | ||
|- | |||
! style="width: 75px" | Index | |||
! style="width: 75px" | Type | |||
! style="width: 250px" | Meaning | |||
|- | |||
| 16 | |||
| Byte | |||
| Climbing | |||
|} | |||
=== | === Cave Spider === | ||
<sup>Extends [[#Spider|Spider]]</sup> | |||
=== | === Creeper === | ||
<sup>Extends [[#Living Entity|Living Entity]]</sup> | |||
{| class="wikitable" | |||
|- | |||
! style="width: 75px" | Index | |||
! style="width: 75px" | Type | |||
! style="width: 250px" | Meaning | |||
|- | |||
| 16 | |||
| Byte | |||
| State (-1 = Idle, 1 = Fuse) | |||
|- | |||
| 17 | |||
| Byte | |||
| Is Powered | |||
|} | |||
=== Ghast === | |||
<sup>Extends [[#Living Entity|Living Entity]]</sup> | |||
==== | {| class="wikitable" | ||
|- | |||
! style="width: 75px" | Index | |||
! style="width: 75px" | Type | |||
! style="width: 250px" | Meaning | |||
|- | |||
| 16 | |||
| Byte | |||
| Is Attacking | |||
|} | |||
=== Slime === | |||
<sup>Extends [[#Living Entity|Living Entity]]</sup> | |||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
! | ! style="width: 75px" | Index | ||
! | ! style="width: 75px" | Type | ||
! style="width: 250px" | Meaning | |||
|- | |||
| 16 | |||
| Byte | |||
| Size | |||
|- | |||
| | |||
| | |||
| | |||
|} | |} | ||
=== Magma Cube === | |||
<sup>Extends [[#Slime|Slime]]</sup> | |||
=== Skeleton === | |||
<sup>Extends [[#Living Entity|Living Entity]]</sup> | |||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
! | ! style="width: 75px" | Index | ||
! | ! style="width: 75px" | Type | ||
! style="width: 250px" colspan="2" | Meaning | |||
|- | |- | ||
| | | rowspan="3" | 13 | ||
| | | rowspan="3" | Byte | ||
! Value !! Meaning | |||
|- | |- | ||
| | | 0 || Normal | ||
| | |- | ||
| 1 || Wither | |||
|- | |||
| | |||
| | |||
|} | |} | ||
=== Witch === | |||
<sup>Extends [[#Living Entity|Living Entity]]</sup> | |||
{| class="wikitable" | |||
|- | |||
! style="width: 75px" | Index | |||
! style="width: 75px" | Type | |||
! style="width: 250px"| Meaning | |||
|- | |||
| 21 | |||
| Byte | |||
| Is Agressive | |||
|} | |||
=== | === Iron Golem === | ||
<sup>Extends [[#Living Entity|Living Entity]]</sup> | |||
==== | {| class="wikitable" | ||
|- | |||
! style="width: 75px" | Index | |||
! style="width: 75px" | Type | |||
! style="width: 250px"| Meaning | |||
|- | |||
| 16 | |||
| Byte | |||
| Is Player Created | |||
|} | |||
=== | === Wither === | ||
<sup>Extends [[#Living Entity|Living Entity]]</sup> | |||
{| class="wikitable" | |||
|- | |||
! style="width: 75px" | Index | |||
! style="width: 75px" | Type | |||
! style="width: 250px"| Meaning | |||
|- | |||
| 17 | |||
| Int | |||
| Watched Target | |||
|- | |||
| 18 | |||
| Int | |||
| Watched Target | |||
|- | |||
| 19 | |||
| Int | |||
| Watched Target | |||
|- | |||
| 20 | |||
| Int | |||
| Invulnerable Time | |||
|} | |||
=== Boat === | |||
<sup>Extends [[#Entity|Entity]]</sup> | |||
==== | {| class="wikitable" | ||
|- | |||
! style="width: 75px" | Index | |||
! style="width: 75px" | Type | |||
! style="width: 250px"| Meaning | |||
|- | |||
| 17 | |||
| Int | |||
| Time Since Hit | |||
|- | |||
| 18 | |||
| Int | |||
| Forward Direction | |||
|- | |||
| 19 | |||
| Float | |||
| Damage Taken | |||
|} | |||
=== | === Minecart === | ||
<sup>Extends [[#Entity|Entity]]</sup> | |||
{| class="wikitable" | |||
|- | |||
! style="width: 75px" | Index | |||
! style="width: 75px" | Type | |||
! style="width: 250px" colspan="2" | Meaning | |||
|- | |||
| 17 | |||
| Int | |||
| colspan="2" | Shaking Power | |||
|- | |||
| 18 | |||
| Int | |||
| colspan="2" | Shaking Direction | |||
|- | |||
| 19 | |||
| Float | |||
| colspan="2" | Damage Taken | |||
|- | |||
| rowspan="3" | 20 | |||
| rowspan="3" | Int | |||
! Bit Mask !! Meaning | |||
|- | |||
| 0x00FF || Block Id | |||
|- | |||
| 0xFF00 || Block Data | |||
|- | |||
| 21 | |||
| Int | |||
| colspan="2" | Block Y Position | |||
|- | |||
| 22 | |||
| Byte | |||
| colspan="2" | Show Block | |||
|} | |||
=== Furnace Minecart === | |||
<sup>Extends [[#Minecart|Minecart]]</sup> | |||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
! style="width: 75px" | Index | |||
! | ! style="width: 75px" | Type | ||
! | ! style="width: 250px" | Meaning | ||
! | |- | ||
| 16 | |||
| Byte | |||
| Is Powered | |||
|- | |||
| | |||
| | |||
| | |||
|} | |} | ||
==== | === Item === | ||
<sup>Extends [[#Entity|Entity]]</sup> | |||
{| class="wikitable" | |||
|- | |||
! style="width: 75px" | Index | |||
! style="width: 75px" | Type | |||
! style="width: 250px" | Meaning | |||
|- | |||
| 10 | |||
| Slot | |||
| Item | |||
|} | |||
=== | === Arrow === | ||
<sup>Extends [[#Entity|Entity]]</sup> | |||
{| class="wikitable" | |||
|- | |||
! style="width: 75px" | Index | |||
! style="width: 75px" | Type | |||
! style="width: 250px" | Meaning | |||
|- | |||
| 16 | |||
| Byte | |||
| Is Critical | |||
|} | |||
=== Firework === | |||
<sup>Extends [[#Entity|Entity]]</sup> | |||
==== | {| class="wikitable" | ||
|- | |||
! style="width: 75px" | Index | |||
! style="width: 75px" | Type | |||
! style="width: 250px" | Meaning | |||
|- | |||
| 8 | |||
| Slot | |||
| Firework Info | |||
|} | |||
=== Item Frame === | |||
<sup>Extends [[#Entity|Entity]]</sup> | |||
{| class="wikitable" | |||
|- | |||
! style="width: 75px" | Index | |||
! style="width: 75px" | Type | |||
! style="width: 250px" | Meaning | |||
|- | |||
| 2 | |||
| Slot | |||
| Item | |||
|- | |||
| 3 | |||
| Byte | |||
| Rotation | |||
|} | |||
=== Ender Crystal === | |||
<sup>Extends [[#Entity|Entity]]</sup> | |||
{| class="wikitable" | |||
|- | |||
! style="width: 75px" | Index | |||
! style="width: 75px" | Type | |||
! style="width: 250px" | Meaning | |||
|- | |||
| 8 | |||
| Int | |||
| Health | |||
|} | |||
Revision as of 15:52, 18 July 2013
Mobs
Mobs are spawned via 0x18 Mob Spawn
| Type | Name | x, z | y |
|---|---|---|---|
| 50 | Creeper | 0.6 | 1.8 |
| 51 | Skeleton | 0.6 | 1.8 |
| 52 | Spider | 1.4 | 0.9 |
| 53 | Giant Zombie | 3.6 | 10.8 |
| 54 | Zombie | 0.6 | 1.8 |
| 55 | Slime | 0.6 * size | 0.6 * size |
| 56 | Ghast | 4 | 4 |
| 57 | Zombie Pigman | 0.6 | 1.8 |
| 58 | Enderman | ||
| 59 | Cave Spider | ||
| 60 | Silverfish | ||
| 61 | Blaze | ||
| 62 | Magma Cube | 0.6 * size | 0.6 * size |
| 63 | Ender Dragon | ||
| 64 | Wither | ||
| 65 | Bat | ||
| 66 | Witch | ||
| 90 | Pig | 0.9 | 0.9 |
| 91 | Sheep | 0.6 | 1.3 |
| 92 | Cow | 0.9 | 1.3 |
| 93 | Chicken | 0.3 | 0.4 |
| 94 | Squid | 0.95 | 0.95 |
| 95 | Wolf | 0.6 | 1.8 |
| 96 | Mooshroom | ||
| 97 | Snowman | ||
| 98 | Ocelot | ||
| 99 | Iron Golem | ||
| 100 | Horse | ||
| 120 | Villager |
Objects
Objects are spawned via 0x17 Spawn Object/Vehicle. See Object Data for more details.
| ID | Name | x, z | y |
|---|---|---|---|
| 1 | Boat | 1.5 | 0.6 |
| 2 | Item Stack (Slot) | 0.5 | 0.5 |
| 10 | Minecart | 0.98 | 0.7 |
| 11 | Minecart (storage) | 0.98 | 0.7 |
| 12 | Minecart (powered) | 0.98 | 0.7 |
| 50 | Activated TNT | 0.98 | 0.98 |
| 51 | EnderCrystal | 1.25? | 2.25? |
| 60 | Arrow (projectile) | 0.5 | 0.5 |
| 61 | Snowball (projectile) | 0.25 | 0.25 |
| 62 | Egg (projectile) | 0.25 | 0.25 |
| 65 | Thrown Enderpearl | ||
| 66 | Wither Skull | ||
| 70 | Falling Objects | 0.98 | 0.98 |
| 71 | Item frames | ? | ? |
| 72 | Eye of Ender | ||
| 73 | Thrown Potion | ||
| 74 | Falling Dragon Egg | 0.98 | 0.98 |
| 75 | Thrown Exp Bottle | ||
| 90 | Fishing Float | 0.25? | 0.25? |
Entity Metadata
Entity Metadata Format
Note that entity metadata is a totally distinct concept from block metadata. All entities must send at least one item of metadata, in most cases this will be the health item.
The entity metadata format is quirky dictionary format, where the key and the value's type are packed in a single byte.
To parse, repeat the following procedure:
- Read an unsigned byte
- If this byte == 127, stop reading
- Decompose the byte.
The bottom 5 bits (0x1F) serve as an identifier (key) for the data to follow.
The top 3 bits (0xE0) serve as a type. - Read and unpack based on the type (below)
| Type | Meaning |
|---|---|
| 0 | Byte |
| 1 | Short |
| 2 | Int |
| 3 | Float |
| 4 | String16 |
| 5 | Slot |
| 6* | Int, Int, Int (x, y, z) |
*Not currently used
In C-like psuedocode:
<source lang="c">
do {
item = readByte();
if (item == 0x7F) break;
var index = item & 0x1F;
var type = item >> 5;
if (type == 0) metadata[index] = readByte();
if (type == 1) metadata[index] = readShort();
if (type == 2) metadata[index] = readInt();
if (type == 3) metadata[index] = readFloat();
if (type == 4) metadata[index] = readString16();
if (type == 5) metadata[index] = readSlot();
if (type == 6) {
var vector;
vector.x = readInt();
vector.y = readInt();
vector.z = readInt();
metadata[index] = vector;
}
} while (true); </source>
Entity
| Index | Type | Meaning | |
|---|---|---|---|
| 0 | Byte | Bit Mask | Meaning |
| 0x01 | On Fire | ||
| 0x02 | Crouched | ||
| 0x08 | Sprinting | ||
| 0x10 | Eating/Drinking/Blocking | ||
| 0x20 | Invisible | ||
| 1 | Short | Air | |
Living Entity
Extends Entity
| Index | Type | Meaning |
|---|---|---|
| 6 | Float | Health |
| 7 | Int | Potion Effect Color |
| 8 | Byte | Is Potion Effect Ambient |
| 9 | Byte | Number of Arrows in Entity |
| 10 | String | Name Tag |
| 11 | Byte | Always Show Name Tag |
Ageable
Extends Living Entity
| Index | Type | Meaning |
|---|---|---|
| 12 | Int | Entity's Age (Negative = Child) |
Horse
Extends Ageable
| Index | Type | Meaning | ||
|---|---|---|---|---|
| 16 | Int | Bit Mask | Meaning | |
| 0x02 | Is Tame | |||
| 0x04 | Has Saddle | |||
| 0x08 | Has Chest | |||
| 0x10 | Is bred | |||
| 0x20 | Is Eating | |||
| 0x40 | Is Rearing | |||
| 0x80 | Mouth Open | |||
| 19 | Byte | Value | Type | |
| 0 | Horse | |||
| 1 | Donkey | |||
| 2 | Mule | |||
| 3 | Zombie | |||
| 4 | Skeleton | |||
| 20 | Int | Bit Mask | Meaning | |
| 0x00FF | Value | Color | ||
| 0 | White | |||
| 1 | Creamy | |||
| 2 | Chestnut | |||
| 3 | Brown | |||
| 4 | Black | |||
| 5 | Gray | |||
| 6 | Dark Down | |||
| 0xFF00 | Value | Style | ||
| 0 | None | |||
| 1 | White | |||
| 2 | Whitefield | |||
| 3 | White Dots | |||
| 4 | Black Dots | |||
| 21 | String | Owner Name | ||
| 22 | Int | Value | Type | |
| 0 | No Armor | |||
| 1 | Iron Armor | |||
| 2 | Gold Armor | |||
| 3 | Diamond Armor | |||
Bat
Extends Living Entity
| Index | Type | Meaning |
|---|---|---|
| 16 | Byte | Is Hanging |
Tameable
Extends Ageable
| Index | Type | Meaning | |
|---|---|---|---|
| 16 | Byte | Bit Mask | Meaning |
| 0x01 | Is Sitting | ||
| 0x04 | Is Tame | ||
| 17 | String | Owner Name | |
Ocelot
Extends Tameable
| Index | Type | Meaning |
|---|---|---|
| 18 | Byte | Ocelot Type |
Wolf
Extends Tameable
| Index | Type | Meaning | |
|---|---|---|---|
| 16 | Byte | Bit Mask | Meaning |
| Flags from Tameable | |||
| 0x02 | Is Angry | ||
| 18 | Float | Health | |
| 19 | Byte | Begging | |
| 20 | Byte | Collar Color | |
Pig
Extends Ageable
| Index | Type | Meaning |
|---|---|---|
| 16 | Byte | Has Saddle |
Sheep
Extends Ageable
| Index | Type | Meaning | ||
|---|---|---|---|---|
| 16 | Byte | Bit Mask | Meaning | |
| 0x0F | Value | Color | ||
| 0 | White | |||
| 1 | Orange | |||
| 2 | Magenta | |||
| 3 | Light Blue | |||
| 4 | Yellow | |||
| 5 | Lime | |||
| 6 | Pink | |||
| 7 | Gray | |||
| 8 | Silver | |||
| 9 | Cyan | |||
| 10 | Purple | |||
| 11 | Blue | |||
| 12 | Brown | |||
| 13 | Green | |||
| 14 | Red | |||
| 15 | Black | |||
| 0x10 | Is Sheared | |||
Villager
Extends Ageable
| Index | Type | Meaning | |
|---|---|---|---|
| 16 | Int | Value | Profession |
| 0 | Farmer | ||
| 1 | Librarian | ||
| 2 | Priest | ||
| 3 | Blacksmith | ||
| 4 | Butcher | ||
Enderman
Extends Living Entity
| Index | Type | Meaning |
|---|---|---|
| 16 | Byte | Carried Block |
| 17 | Byte | Carried Block Data |
| 18 | Byte | Is Screaming |
Zombie
Extends Living Entity
| Index | Type | Meaning |
|---|---|---|
| 12 | Byte | Is Child |
| 13 | Byte | Is Villager |
| 14 | Byte | Is Converting |
Zombie Pigman
Extends Zombie
Blaze
Extends Living Entity
| Index | Type | Meaning |
|---|---|---|
| 16 | Byte | On Fire |
Spider
Extends Living Entity
| Index | Type | Meaning |
|---|---|---|
| 16 | Byte | Climbing |
Cave Spider
Extends Spider
Creeper
Extends Living Entity
| Index | Type | Meaning |
|---|---|---|
| 16 | Byte | State (-1 = Idle, 1 = Fuse) |
| 17 | Byte | Is Powered |
Ghast
Extends Living Entity
| Index | Type | Meaning |
|---|---|---|
| 16 | Byte | Is Attacking |
Slime
Extends Living Entity
| Index | Type | Meaning |
|---|---|---|
| 16 | Byte | Size |
Magma Cube
Extends Slime
Skeleton
Extends Living Entity
| Index | Type | Meaning | |
|---|---|---|---|
| 13 | Byte | Value | Meaning |
| 0 | Normal | ||
| 1 | Wither | ||
Witch
Extends Living Entity
| Index | Type | Meaning |
|---|---|---|
| 21 | Byte | Is Agressive |
Iron Golem
Extends Living Entity
| Index | Type | Meaning |
|---|---|---|
| 16 | Byte | Is Player Created |
Wither
Extends Living Entity
| Index | Type | Meaning |
|---|---|---|
| 17 | Int | Watched Target |
| 18 | Int | Watched Target |
| 19 | Int | Watched Target |
| 20 | Int | Invulnerable Time |
Boat
Extends Entity
| Index | Type | Meaning |
|---|---|---|
| 17 | Int | Time Since Hit |
| 18 | Int | Forward Direction |
| 19 | Float | Damage Taken |
Minecart
Extends Entity
| Index | Type | Meaning | |
|---|---|---|---|
| 17 | Int | Shaking Power | |
| 18 | Int | Shaking Direction | |
| 19 | Float | Damage Taken | |
| 20 | Int | Bit Mask | Meaning |
| 0x00FF | Block Id | ||
| 0xFF00 | Block Data | ||
| 21 | Int | Block Y Position | |
| 22 | Byte | Show Block | |
Furnace Minecart
Extends Minecart
| Index | Type | Meaning |
|---|---|---|
| 16 | Byte | Is Powered |
Item
Extends Entity
| Index | Type | Meaning |
|---|---|---|
| 10 | Slot | Item |
Arrow
Extends Entity
| Index | Type | Meaning |
|---|---|---|
| 16 | Byte | Is Critical |
Firework
Extends Entity
| Index | Type | Meaning |
|---|---|---|
| 8 | Slot | Firework Info |
Item Frame
Extends Entity
| Index | Type | Meaning |
|---|---|---|
| 2 | Slot | Item |
| 3 | Byte | Rotation |
Ender Crystal
Extends Entity
| Index | Type | Meaning |
|---|---|---|
| 8 | Int | Health |