Interface ItemAction
- All Known Subinterfaces:
ItemAction.ApplyEffects, ItemAction.ClearEffects, ItemAction.PlaySound, ItemAction.RemoveEffects, ItemAction.TeleportRandomly
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceAppliesPotionEffects with chance.static interfaceClears allPotionEffects.static interfacestatic interfacePlaysSoundType.static interfaceRemovesPotionEffects with matchingPotionEffectTypes.static interfaceTeleports randomly within maximum distance. -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanApplies this effect withItemStack.empty().booleanapply(Living entity, ItemStackLike stack) Tries to apply this effect and returns whether it was successfully applied.static ItemAction.ApplyEffectsapplyEffects(double chance, Collection<PotionEffect> effects) static ItemAction.ApplyEffectsapplyEffects(double chance, PotionEffect... effects) static ItemAction.ApplyEffectsapplyEffects(Collection<PotionEffect> effects) static ItemAction.ApplyEffectsapplyEffects(PotionEffect... effects) static ItemAction.ClearEffectsstatic ItemAction.PlaySoundstatic ItemAction.PlaySoundstatic ItemAction.RemoveEffectsremoveEffects(Collection<PotionEffectType> effectTypes) static ItemAction.RemoveEffectsremoveEffects(Supplier<PotionEffectType>... effectTypes) static ItemAction.RemoveEffectsremoveEffects(PotionEffectType... effectTypes) static ItemAction.RemoveEffectsremoveEffects(Tag<PotionEffectType> effectTypeTag) static ItemAction.TeleportRandomlyteleportRandomly(double distance) static ItemAction.TeleportRandomlyteleportRandomly(double distance, boolean directionalParticles) type()Returns the type of this effect.
-
Method Details
-
applyEffects
-
applyEffects
-
applyEffects
-
applyEffects
-
removeEffects
-
removeEffects
-
removeEffects
@SafeVarargs static ItemAction.RemoveEffects removeEffects(Supplier<PotionEffectType>... effectTypes) -
removeEffects
-
clearEffects
-
playSound
-
playSound
-
teleportRandomly
-
teleportRandomly
-
type
-
apply
Tries to apply this effect and returns whether it was successfully applied. The definition of success is purely left up to the implementation.- Parameters:
entity- The entity to apply effect tostack- The item to apply effect with- Returns:
- true if effect was successfully applied
-
apply
Applies this effect withItemStack.empty().- Parameters:
entity- The entity to apply effect to- Returns:
- true if effect was successfully applied
- See Also:
-