Interface Animal

All Superinterfaces:
Ageable, Agent, ArmorEquipable, Attackable, AttributeHolder, Breedable, CopyableDataHolder, DataHolder, DataHolder.Mutable, DataSerializable, Entity, EntityProjectileSource, Equipable, HoverEventSource<HoverEvent.ShowEntity>, Identifiable, Leashable, Living, Locatable, PathfinderAgent, ProjectileSource, RandomProvider, SerializableDataHolder, SerializableDataHolder.Mutable, Sound.Emitter, Targeting, TeamMember, ValueContainer
All Known Subinterfaces:
Armadillo, Axolotl, Bee, Camel, Cat, Chicken, Cow, Donkey, Fox, Frog, Goat, Hoglin, Horse, HorseLike, Llama, Mooshroom, Mule, Ocelot, PackHorse, Panda, Parrot, Pig, PolarBear, Rabbit, Sheep, SkeletonHorse, Sniffer, Strider, TameableAnimal, TraderLlama, Turtle, Wolf, ZombieHorse

public interface Animal extends PathfinderAgent, Ageable, Breedable
Represents an animal, such as a Cow.
  • Method Details

    • breeder

      default Optional<Value.Mutable<UUID>> breeder()
      Returns:
      The current breeder of the animal
    • isFood

      boolean isFood(ItemStack stack)
      Determines if the ItemStack is considered to be food by this animal.
      Parameters:
      stack - The stack
      Returns:
      True if food, false if not
    • canBreedWith

      boolean canBreedWith(Animal other)
      Determines if this animal can be bred with the provided animal. In vanilla, two animals can only be breed if they are the same EntityType and are adults.
      Parameters:
      other - The animal
      Returns:
      True if can breed with, false if not
    • breedWith

      void breedWith(Animal animal)
      Instructs this animal to breed with the provided animal.
      Parameters:
      animal - The animal to breed with