Skip to main content

Module item

Module item 

Source
Expand description

Item entity implementation (dropped items).

ItemEntity represents a dropped item in the world. It has physics (gravity, friction), despawns after 5 minutes, and can be picked up by players after a short delay.

Structsยง

ItemEntity
A dropped item entity.
ItemEntityState ๐Ÿ”’
Mutable item-specific state that changes during item ticks, pickup, damage, merging, and save/load.

Constantsยง

AIR_DRAG ๐Ÿ”’
Air/vertical drag multiplier per tick.
DEFAULT_GRAVITY ๐Ÿ”’
Gravity applied per tick (blocks/tick^2). Vanilla: ItemEntity.getDefaultGravity()
DEFAULT_HEALTH ๐Ÿ”’
Default health (damage resistance).
DEFAULT_PICKUP_DELAY ๐Ÿ”’
Pickup delay set by set_default_pickup_delay() (0.5 seconds = 10 ticks). Note: Items spawn with 0 delay by default; this is only used when explicitly set.
FLUID_VERTICAL_NUDGE ๐Ÿ”’
INFINITE_LIFETIME ๐Ÿ”’
Age value meaning โ€œinfinite lifetimeโ€ (never despawns).
INFINITE_PICKUP_DELAY ๐Ÿ”’
Pickup delay value meaning โ€œnever pickupableโ€.
ITEM_FLUID_HEIGHT_THRESHOLD ๐Ÿ”’
ITEM_LAVA_DRAG ๐Ÿ”’
ITEM_WATER_DRAG ๐Ÿ”’
LIFETIME ๐Ÿ”’
Maximum age in ticks before despawn (5 minutes = 6000 ticks).
MERGE_MAX_STACK_SIZE ๐Ÿ”’