接口 Tameable

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

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

    • isTamed

      boolean isTamed()
      检查是否已被驯服

      如果某物已被驯服,则玩家无法通过常规方法驯服它,即使它不属于任何特定玩家。

      返回:
      如果已被驯服则返回true

      原文: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.

    • setTamed

      void setTamed(boolean tame)
      设置是否已被驯服。如果已使用setOwner方法,则此方法不是必需的,因为它会自动驯服。

      如果某物已被驯服,则玩家无法通过常规方法驯服它,即使它不属于任何特定玩家。

      参数:
      tame - 如果为true则表示驯服

      原文: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

      获取当前所有者AnimalTamer
      返回:
      所有者AnimalTamer,如果没有所有者则返回null

      原文:Gets the current owning AnimalTamer

    • setOwner

      void setOwner(@Nullable @Nullable AnimalTamer tamer)
      设置此实体的所有者为给定的AnimalTamer。

      如果所有者不为null,则此实体将被驯服,并移除其当前跟随的路径。如果所有者设置为null,则此实体将被解除驯服,并移除当前所有者。

      参数:
      tamer - 应拥有此实体的AnimalTamer

      原文: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