接口 ConsumableComponent
- 所有超级接口:
ConfigurationSerializable
Represents a component which item can be consumed on use.
-
嵌套类概要
嵌套类修饰符和类型接口说明static enum
Represents the animations for an item being consumed. -
方法概要
修饰符和类型方法说明addEffect
(@NotNull 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
(@NotNull 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
(@NotNull 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.从接口继承的方法 org.bukkit.configuration.serialization.ConfigurationSerializable
serialize
-
方法详细资料
-
getConsumeSeconds
float getConsumeSeconds()Gets the time in seconds it will take for this item to be consumed.- 返回:
- consume time
-
setConsumeSeconds
void setConsumeSeconds(float consumeSeconds) Sets the time in seconds it will take for this item to be consumed.- 参数:
consumeSeconds
- new consume time
-
getAnimation
Gets the animation used during consumption of the item.- 返回:
- animation
-
setAnimation
Sets the animation used during consumption of the item.- 参数:
animation
- the new animation
-
getSound
Gets the sound to play during and on completion of the item's consumption.- 返回:
- the sound
-
setSound
Sets the sound to play during and on completion of the item's consumption.- 参数:
sound
- sound or null for current default
-
hasConsumeParticles
boolean hasConsumeParticles()Gets whether consumption particles are emitted while consuming this item.- 返回:
- true for particles emitted while consuming, false otherwise
-
setConsumeParticles
void setConsumeParticles(boolean consumeParticles) Sets whether consumption particles are emitted while consuming this item.- 参数:
consumeParticles
- if particles need to be emitted while consuming the item
-
getEffects
Gets the effects which may be applied by this item when consumed.- 返回:
- consumable effects
-
setEffects
Sets the effects which may be applied by this item when consumed.- 参数:
effects
- new effects
-
addEffect
Adds an effect which may be applied by this item when consumed.- 参数:
effect
- the effect- 返回:
- the added effect
-