Skip to content

Spawn Item

Packet IDDirectionMojang NameMCP Name
0x15ClientboundAddItemEntityPacketPacket21PickupSpawn

Sent to the client when an item entity should be spawned. The position and rotation are in entity space.

Clientbound

FieldTypeDescription
Entity IDIntegerThe ID of the entity that will refer to this item
Item IDShortThe ID of the item
Item AmountByteThe quantity of items
Item MetadataShortThe metadata value
XIntegerThe X position of the item entity (Quantized)
YIntegerThe Y position of the item entity (Quantized)
ZIntegerThe Z position of the item entity (Quantized)
PitchByteQuantized Velocity in the X axis
YawByteQuantized Velocity in the Y axis
RollByteQuantized Velocity in the Z axis

NOTE

This is not a typo. Notch indeed used the Pitch, Yaw and Roll fields of the SpawnItem packet to carry the initial velocity. For quantization, multiply the velocity by 128, cast to int8 and then cast to byte.

Example Packet

FieldValue
Entity ID1298
Item ID17 (Log)
Item Quantity1
Item Metadata0 (Oak Log)
X5669 (177.15)
Y2176 (68.0)
Z-5325 (-166.40)
Yaw16 (22.58)
Pitch9 (12.70)
Roll0 (0.0)