接口 Tameable

所有超级接口:
Ageable, Animals, Attributable, Breedable, CommandSender, Creature, Damageable, Entity, LivingEntity, Lootable, Metadatable, Mob, Nameable, Permissible, PersistentDataHolder, ProjectileSource, ServerOperator
所有已知子接口:
AbstractHorse, Camel, Cat, ChestedHorse, Donkey, Horse, Llama, Mule, Parrot, SkeletonHorse, TraderLlama, Wolf, ZombieHorse

public interface Tameable extends Animals
  • 方法详细资料

    • isTamed

      boolean isTamed()
      Check if this is tamed

      If something is tamed then a player can not tame it through normal methods, even if it does not belong to anyone in particular.

      返回:
      true if this has been tamed
    • setTamed

      void setTamed(boolean tame)
      Sets if this has been tamed. Not necessary if the method setOwner has been used, as it tames automatically.

      If something is tamed then a player can not tame it through normal methods, even if it does not belong to anyone in particular.

      参数:
      tame - true if tame
    • getOwner

      Gets the current owning AnimalTamer
      返回:
      the owning AnimalTamer, or null if not owned
    • setOwner

      void setOwner(@Nullable @Nullable AnimalTamer tamer)
      Set this to be owned by given AnimalTamer.

      If the owner is not null, this will be tamed and will have any current path it is following removed. If the owner is set to null, this will be untamed, and the current owner removed.

      参数:
      tamer - the AnimalTamer who should own this