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
Modifier and TypeInterfaceDescriptionstatic interface
Represents a consumable effect that applies 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 consumptionstatic interface
-
Method Summary
Modifier and TypeMethodDescriptionapplyStatusEffects
(List<PotionEffect> effects, float probability) Creates a consume effect that gives status 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.Creates a consume effect that gives 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
-
removeEffects
@Contract(value="_ -> new", pure=true) static ConsumeEffect.RemoveStatusEffects removeEffects(RegistryKeySet<PotionEffectType> key) Creates a consume effect that gives status effects on consumption.- Parameters:
key
- the sound effect to play- Returns:
- the effect
-
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 sound effect to play- Returns:
- the effect
-
clearAllStatusEffects
@Contract(value="-> new", pure=true) static ConsumeEffect.ClearAllStatusEffects clearAllStatusEffects()Creates a consume effect that clears all status effects.- Returns:
- effect instance
-
applyStatusEffects
@Contract(value="_, _ -> new", pure=true) static ConsumeEffect.ApplyStatusEffects applyStatusEffects(List<PotionEffect> effects, float probability) Creates a consume effect that gives status 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
-