Interface ConsumeEffect
- All Known Subinterfaces:
ConsumeEffect.ApplyStatusEffects
,ConsumeEffect.ClearAllStatusEffects
,ConsumeEffect.PlaySound
,ConsumeEffect.RemoveStatusEffects
,ConsumeEffect.TeleportRandomly
Effect that occurs when consuming an item.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
Represents a consumable effect that applies potion effects based on a probability on consumption.static interface
Represents a consumable effect that clears all effects on consumption.static interface
Represents a consumable effect that plays a sound on consumption.static interface
Represents a consumable effect that removes status effects on consumption.static interface
Represents a consumable effect that randomly teleports the entity on consumption. -
Method Summary
Static MethodsModifier and TypeMethodDescriptionapplyStatusEffects
(List<PotionEffect> effects, float probability) Creates a consume effect that gives potion effects on consumption.Creates a consume effect that clears all status effects.static ConsumeEffect.PlaySound
Creates a consume effect that plays a sound on consumption.removeEffects
(RegistryKeySet<PotionEffectType> effects) Creates a consume effect that removes status effects on consumption.teleportRandomlyEffect
(float diameter) Creates a consume effect that randomly teleports the entity on consumption.
-
Method Details
-
teleportRandomlyEffect
@Contract(value="_ -> new", pure=true) static ConsumeEffect.TeleportRandomly teleportRandomlyEffect(float diameter) Creates a consume effect that randomly teleports the entity on consumption.- Parameters:
diameter
- diameter of random teleportation- Returns:
- the effect instance
-
removeEffects
@Contract(value="_ -> new", pure=true) static ConsumeEffect.RemoveStatusEffects removeEffects(RegistryKeySet<PotionEffectType> effects) Creates a consume effect that removes status effects on consumption.- Parameters:
effects
- the potion effects to remove- Returns:
- the effect instance
-
playSoundConsumeEffect
@Contract(value="_ -> new", pure=true) static ConsumeEffect.PlaySound playSoundConsumeEffect(Key key) Creates a consume effect that plays a sound on consumption.- Parameters:
key
- the key sound effect to play- Returns:
- the effect instance
-
clearAllStatusEffects
@Contract(value="-> new", pure=true) static ConsumeEffect.ClearAllStatusEffects clearAllStatusEffects()Creates a consume effect that clears all status effects.- Returns:
- the effect instance
-
applyStatusEffects
@Contract(value="_, _ -> new", pure=true) static ConsumeEffect.ApplyStatusEffects applyStatusEffects(List<PotionEffect> effects, float probability) Creates a consume effect that gives potion effects on consumption.- Parameters:
effects
- the potion effects to applyprobability
- the probability of these effects being applied, between 0 and 1 inclusive- Returns:
- the effect instance
-