接口 UseCooldownComponent

所有超级接口:
ConfigurationSerializable

@Experimental public interface UseCooldownComponent extends ConfigurationSerializable
表示一个决定此物品使用冷却时间的组件。
  • 方法详细资料

    • getCooldownSeconds

      float getCooldownSeconds()
      获取此冷却组中的物品可以再次使用所需的时间(以秒为单位)。

      原文:Gets the time in seconds it will take for an item in this cooldown group to be available to use again.

      返回:
      冷却时间
    • setCooldownSeconds

      void setCooldownSeconds(float cooldown)
      设置此冷却组中的物品可以再次使用所需的时间(以秒为单位)。

      原文:Sets the time in seconds it will take for an item in this cooldown group to be available to use again.

      参数:
      cooldown - 新的冷却时间,必须大于0
    • getCooldownGroup

      @Nullable @Nullable NamespacedKey getCooldownGroup()
      获取用于相似物品的自定义冷却组(如果已设置)。

      原文:Gets the custom cooldown group to be used for similar items, if set.

      返回:
      冷却组
    • setCooldownGroup

      void setCooldownGroup(@Nullable @Nullable NamespacedKey key)
      设置用于相似物品的自定义冷却组。

      原文:Sets the custom cooldown group to be used for similar items.

      参数:
      key - 冷却组