接口 Allay

所有超级接口:
Attributable, CommandSender, Creature, Damageable, Entity, InventoryHolder, Leashable, LivingEntity, Lootable, Metadatable, Mob, Nameable, Permissible, PersistentDataHolder, ProjectileSource, ServerOperator

public interface Allay extends Creature, InventoryHolder
悦灵生物.
  • 方法详细资料

    • canDuplicate

      boolean canDuplicate()
      获取悦灵是否可以复制.
      注意: 复制取决于 getDuplicationCooldown() 是否小于零.

      原文:Gets if the allay can duplicate.
      Note: Duplication is based when the getDuplicationCooldown() its lower than zero.

      返回:
      悦灵是否可以复制自身.
    • setCanDuplicate

      void setCanDuplicate(boolean canDuplicate)
      设置悦灵是否可以复制.
      注意: 此值可能会被 getDuplicationCooldown() 覆盖, 如果冷却时间小于零. 你也可以使用 setDuplicationCooldown(long) 来允许悦灵复制.

      原文:Sets if the allay can duplicate.
      Note: this value can be overridden later by getDuplicationCooldown() if is lower than zero. You can also use setDuplicationCooldown(long) to allow the allay to duplicate

      参数:
      canDuplicate - 悦灵是否可以复制自身
    • getDuplicationCooldown

      long getDuplicationCooldown()
      获取悦灵复制的冷却时间.

      原文:Gets the cooldown for duplicating the allay.

      返回:
      悦灵可以复制的时间 (以 tick 为单位)
    • setDuplicationCooldown

      void setDuplicationCooldown(long cooldown)
      设置悦灵再次复制前的冷却时间.

      原文:Sets the cooldown before the allay can duplicate again.

      参数:
      cooldown - 冷却时间, 使用负数来阻止悦灵再次复制.
    • resetDuplicationCooldown

      void resetDuplicationCooldown()
      重置复制的冷却时间. 这会将冷却时间设置为与悦灵复制后相同的值.

      原文:Reset the cooldown for duplication. This will set the cooldown ticks to the same value as is set after an Allay has duplicated.

    • isDancing

      boolean isDancing()
      获取悦灵是否正在跳舞.

      原文:Gets if the allay is dancing.

      返回:
      True 如果正在跳舞, 否则为 false.
    • startDancing

      void startDancing(@NotNull @NotNull Location location)
      使悦灵因指定的唱片机位置而开始跳舞.

      原文:Causes the allay to start dancing because of the provided jukebox location.

      参数:
      location - 唱片机的位置
      抛出:
      IllegalArgumentException - 如果该位置的方块不是唱片机
    • startDancing

      void startDancing()
      强制设置悦灵的跳舞状态.
      注意: 此方法强制悦灵跳舞, 忽略附近是否有唱片机.

      原文:Force sets the dancing status of the allay.
      Note: This method forces the allay to dance, ignoring any nearby jukebox being required.

    • stopDancing

      void stopDancing()
      使悦灵停止跳舞.

      原文:Makes the allay stop dancing.

    • duplicateAllay

      @Nullable @Nullable Allay duplicateAllay()
      使当前悦灵复制自身, 无需跳舞或物品. 注意: 这将触发 CreatureSpawnEvent

      原文:This make the current allay duplicate itself without dance or item necessary. Note: this will fire a CreatureSpawnEvent

      返回:
      新的 Allay 实体, 如果生成被取消则返回 null
    • getJukebox

      获取悦灵正在跳舞的唱片机.

      原文:Gets the jukebox the allay is set to dance to.

      返回:
      唱片机的位置 (如果存在)