Skip to main content

Module consume_effect

Module consume_effect 

Source
Expand description

Consume-effect behaviors: one small module per vanilla ConsumeEffect subtype under net/minecraft/world/item/consume_effects.

Modules§

apply_effects 🔒
ApplyStatusEffectsConsumeEffect behavior (golden apple, poisonous potato, rotten flesh, etc.). Suspicious stew’s effect is a separate, unrelated SuspiciousStewEffects data component, not this.
clear_all_effects 🔒
ClearAllStatusEffectsConsumeEffect behavior (e.g. milk bucket).
play_sound 🔒
PlaySoundConsumeEffect behavior (e.g. ominous bottle, via Consumable .Builder.soundAfterConsume, sugar for this exact effect).
remove_effects 🔒
RemoveStatusEffectsConsumeEffect behavior (e.g. honey bottle removing Poison).
teleport_randomly 🔒
TeleportRandomlyConsumeEffect behavior (chorus fruit).

Structs§

ApplyEffectsBehavior
Mirrors vanilla ApplyStatusEffectsConsumeEffect.apply: unlike drinking a potion, this always goes through LivingEntity.addEffect
ClearAllEffectsBehavior
Mirrors vanilla ClearAllStatusEffectsConsumeEffect.apply. Carries no fields, so there is nothing to downcast for.
PlaySoundBehavior
Mirrors vanilla PlaySoundConsumeEffect.apply.
RemoveEffectsBehavior
Mirrors vanilla RemoveStatusEffectsConsumeEffect.apply.
TeleportRandomlyBehavior
Mirrors vanilla TeleportRandomlyConsumeEffect.apply.

Traits§

ConsumeEffectBehavior
Mirrors vanilla’s ConsumeEffect.apply(Level, ItemStack, LivingEntity)

Functions§

apply_consume_effect 🔒
Applies one ConsumeEffectData entry from a Consumable.on_consume_effects list, by looking up its registered behavior.