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ยง
- Item
Entity - A dropped item entity.
- Item
Entity ๐State - 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