Interface Animal

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

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

    • breeder

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

      boolean isFood(ItemStack stack)
      Determines if the ItemStack is considered to be food by this animal.
      stack - The stack
      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.
      other - The animal
      True if can breed with, false if not
    • breedWith

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