接口 SkeletonHorse

所有超级接口:
AbstractHorse, Ageable, Animals, Attributable, Breedable, CommandSender, Creature, Damageable, Entity, InventoryHolder, LivingEntity, Lootable, Metadatable, Mob, Nameable, Permissible, PersistentDataHolder, ProjectileSource, ServerOperator, Tameable, Vehicle

public interface SkeletonHorse extends AbstractHorse
Represents a SkeletonHorse - variant of AbstractHorse.
  • 方法详细资料

    • isTrapped

      boolean isTrapped()
      Returns whether this skeleton horse is trapped.

      When a horse is trapped and a player comes within 10 blocks of a trapped horse, lightning will strike the horse. When struck, the skeleton trap will activate, turning the horse into a skeleton horseman as well as spawning three additional horsemen nearby.

      返回:
      true if trapped
    • setTrapped

      void setTrapped(boolean trapped)
      Sets if this skeleton horse is trapped.
      参数:
      trapped - new trapped state
    • getTrapTime

      int getTrapTime()
      Returns the horse's current trap time in ticks. Trap time is incremented every tick when isTrapped() is true. The horse automatically despawns when it reaches 18000 ticks.
      返回:
      current trap time
    • setTrapTime

      void setTrapTime(int trapTime)
      Sets the trap time for the horse. Values greater than 18000 will cause the horse to despawn on the next tick.
      参数:
      trapTime - new trap time