Interface ConsumableComponent
- All Superinterfaces:
ConfigurationSerializable
Represents a component which item can be consumed on use.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enum
Represents the animations for an item being consumed. -
Method Summary
Modifier and TypeMethodDescriptionaddEffect
(ConsumableEffect effect) Adds an effect which may be applied by this item when consumed.Gets the animation used during consumption of the item.float
Gets the time in seconds it will take for this item to be consumed.Gets the effects which may be applied by this item when consumed.getSound()
Gets the sound to play during and on completion of the item's consumption.boolean
Gets whether consumption particles are emitted while consuming this item.void
setAnimation
(ConsumableComponent.Animation animation) Sets the animation used during consumption of the item.void
setConsumeParticles
(boolean consumeParticles) Sets whether consumption particles are emitted while consuming this item.void
setConsumeSeconds
(float consumeSeconds) Sets the time in seconds it will take for this item to be consumed.void
setEffects
(List<ConsumableEffect> effects) Sets the effects which may be applied by this item when consumed.void
Sets the sound to play during and on completion of the item's consumption.Methods inherited from interface org.bukkit.configuration.serialization.ConfigurationSerializable
serialize
-
Method Details
-
getConsumeSeconds
float getConsumeSeconds()Gets the time in seconds it will take for this item to be consumed.- Returns:
- consume time
-
setConsumeSeconds
void setConsumeSeconds(float consumeSeconds) Sets the time in seconds it will take for this item to be consumed.- Parameters:
consumeSeconds
- new consume time
-
getAnimation
Gets the animation used during consumption of the item.- Returns:
- animation
-
setAnimation
Sets the animation used during consumption of the item.- Parameters:
animation
- the new animation
-
getSound
Gets the sound to play during and on completion of the item's consumption.- Returns:
- the sound
-
setSound
Sets the sound to play during and on completion of the item's consumption.- Parameters:
sound
- sound or null for current default
-
hasConsumeParticles
boolean hasConsumeParticles()Gets whether consumption particles are emitted while consuming this item.- Returns:
- true for particles emitted while consuming, false otherwise
-
setConsumeParticles
void setConsumeParticles(boolean consumeParticles) Sets whether consumption particles are emitted while consuming this item.- Parameters:
consumeParticles
- if particles need to be emitted while consuming the item
-
getEffects
Gets the effects which may be applied by this item when consumed.- Returns:
- consumable effects
-
setEffects
Sets the effects which may be applied by this item when consumed.- Parameters:
effects
- new effects
-
addEffect
Adds an effect which may be applied by this item when consumed.- Parameters:
effect
- the effect- Returns:
- the added effect
-