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
Play sound consume effect behavior.
RemoveEffectsBehavior
Remove effects consume effect behavior.
TeleportRandomlyBehavior
Teleport randomly consume effect behavior.

TraitsΒ§

ConsumeEffectBehavior
Behavior for one kind of item consume effect, such as applying, clearing, or removing status effects, playing a sound, or randomly teleporting the consumer.

FunctionsΒ§

apply_consume_effect πŸ”’
Applies one ConsumeEffectData entry from a Consumable.on_consume_effects list, by looking up its registered behavior.