接口 Animals

所有超级接口:
Ageable, Attributable, Breedable, CommandSender, Creature, Damageable, Entity, Leashable, LivingEntity, Lootable, Metadatable, Mob, Nameable, Permissible, PersistentDataHolder, ProjectileSource, ServerOperator
所有已知子接口:
AbstractCow, AbstractHorse, AbstractNautilus, Armadillo, Axolotl, Bee, Camel, CamelHusk, Cat, ChestedHorse, Chicken, Cow, Donkey, Fox, Frog, Goat, HappyGhast, Hoglin, Horse, Llama, Mule, MushroomCow, Nautilus, Ocelot, Panda, Parrot, Pig, PolarBear, Rabbit, Sheep, SkeletonHorse, Sniffer, Steerable, Strider, Tameable, TraderLlama, Turtle, Wolf, ZombieHorse, ZombieNautilus

public interface Animals extends Breedable
代表动物.
  • 方法详细资料

    • getBreedCause

      @Nullable @Nullable UUID getBreedCause()
      获取导致此实体进入 Breedable.canBreed() 状态的实体UUID.

      原文:Get the UUID of the entity that caused this entity to enter the Breedable.canBreed() state.

      返回:
      如果已设置则返回UUID,否则返回null
    • setBreedCause

      void setBreedCause(@Nullable @Nullable UUID uuid)
      设置导致此实体进入 Breedable.canBreed() 状态的实体UUID.

      原文:Set the UUID of the entity that caused this entity to enter the Breedable.canBreed() state.

      参数:
      uuid - 新的UUID,或null
    • isLoveMode

      boolean isLoveMode()
      获取此实体是否处于发情状态,并将与另一个处于发情状态的实体产生后代。当且仅当 getLoveModeTicks() 大于0时返回true.

      原文:Get whether or not this entity is in love mode and will produce offspring with another entity in love mode.

      返回:
      如果处于发情状态则返回true,否则返回false
    • getLoveModeTicks

      int getLoveModeTicks()
      获取此实体剩余的发情状态tick数。如果实体不处于发情状态,将返回0.

      原文:Get the amount of ticks remaining for this entity in love mode.

      返回:
      剩余的发情状态tick数
    • setLoveModeTicks

      void setLoveModeTicks(int ticks)
      设置此实体应处于发情状态的tick数。将发情状态tick数设置为600等同于玩家喂食该实体其选择的繁殖物品.

      原文:Set the amount of ticks for which this entity should be in love mode.

      参数:
      ticks - 发情状态tick数,必须为正数
    • isBreedItem

      boolean isBreedItem(@NotNull @NotNull ItemStack stack)
      检查提供的ItemStack是否是用于繁殖此实体的正确物品.

      原文:Check if the provided ItemStack is the correct item used for breeding this entity.

      参数:
      stack - 要检查的ItemStack
      返回:
      如果提供的ItemStack是此实体的正确食物则返回true
    • isBreedItem

      boolean isBreedItem(@NotNull @NotNull Material material)
      检查提供的Material是否是用于繁殖此实体的正确物品.

      原文:Check if the provided ItemStack is the correct item used for breeding this entity.

      参数:
      material - 要检查的Material
      返回:
      如果提供的Material是此实体的正确食物则返回true