接口 ConsumableComponent
- 所有超级接口:
ConfigurationSerializable
-
嵌套类概要
嵌套类 -
方法概要
修饰符和类型方法说明addEffect(@NotNull ConsumableEffect effect) 添加一个消耗此物品时可能应用的效果。获取消耗物品时使用的动画。float获取消耗此物品所需的时间(以秒为单位)。获取消耗此物品时可能应用的效果。getSound()获取在物品消耗期间和完成时播放的音效。boolean获取消耗此物品时是否发射消耗粒子。voidsetAnimation(@NotNull ConsumableComponent.Animation animation) 设置消耗物品时使用的动画。voidsetConsumeParticles(boolean consumeParticles) 设置消耗此物品时是否发射消耗粒子。voidsetConsumeSeconds(float consumeSeconds) 设置消耗此物品所需的时间(以秒为单位)。voidsetEffects(@NotNull List<ConsumableEffect> effects) 设置消耗此物品时可能应用的效果。void设置在物品消耗期间和完成时播放的音效。从接口继承的方法 org.bukkit.configuration.serialization.ConfigurationSerializable
serialize
-
方法详细资料
-
getConsumeSeconds
float getConsumeSeconds()获取消耗此物品所需的时间(以秒为单位)。原文:Gets the time in seconds it will take for this item to be consumed.
- 返回:
- 消耗时间
-
setConsumeSeconds
void setConsumeSeconds(float consumeSeconds) 设置消耗此物品所需的时间(以秒为单位)。原文:Sets the time in seconds it will take for this item to be consumed.
- 参数:
consumeSeconds- 新的消耗时间
-
getAnimation
获取消耗物品时使用的动画。原文:Gets the animation used during consumption of the item.
- 返回:
- 动画
-
setAnimation
设置消耗物品时使用的动画。原文:Sets the animation used during consumption of the item.
- 参数:
animation- 新的动画
-
getSound
获取在物品消耗期间和完成时播放的音效。原文:Gets the sound to play during and on completion of the item's consumption.
- 返回:
- 音效
-
setSound
设置在物品消耗期间和完成时播放的音效。原文:Sets the sound to play during and on completion of the item's consumption.
- 参数:
sound- 音效或null表示使用当前默认值
-
hasConsumeParticles
boolean hasConsumeParticles()获取消耗此物品时是否发射消耗粒子。原文:Gets whether consumption particles are emitted while consuming this item.
- 返回:
- 如果消耗时发射粒子则返回true,否则返回false
-
setConsumeParticles
void setConsumeParticles(boolean consumeParticles) 设置消耗此物品时是否发射消耗粒子。原文:Sets whether consumption particles are emitted while consuming this item.
- 参数:
consumeParticles- 消耗物品时是否需要发射粒子
-
getEffects
获取消耗此物品时可能应用的效果。原文:Gets the effects which may be applied by this item when consumed.
- 返回:
- 消耗效果
-
setEffects
设置消耗此物品时可能应用的效果。原文:Sets the effects which may be applied by this item when consumed.
- 参数:
effects- 新的效果
-
addEffect
添加一个消耗此物品时可能应用的效果。原文:Adds an effect which may be applied by this item when consumed.
- 参数:
effect- 效果- 返回:
- 添加的效果
-