Skip to main content

Module item

Module item 

Source
Expand description

Item behavior trait and registry.

Structsยง

ItemBehaviorRegistry
Registry for item behaviors.

Enumsยง

ItemUseAnimation
Arm animation displayed while using an item.

Traitsยง

ItemBehavior
Trait defining the behavior of an item.

Functionsยง

apply_use_remainder ๐Ÿ”’
Applies vanilla UseRemainder.convertIntoRemainder: if the original stack had a use_remainder and was actually consumed, either swap the fully emptied stack for the remainder, or โ€” for a stack that still has items left (e.g. one honey bottle out of several)
emit_consume_particles_and_sounds ๐Ÿ”’
Mirrors vanilla Consumable.emitParticlesAndSounds
finish_consuming_stack ๐Ÿ”’
Applies vanilla Consumable.onConsumeโ€™s shared tail: runs on_consume_effects, plays the consume sound, then shrinks the stack by one (creative mode leaves it untouched).
should_emit_consume_particles_and_sounds ๐Ÿ”’