Interface Ageable

All Superinterfaces:
Attributable, Audience, CommandSender, Creature, Damageable, DataComponentView, Entity, Frictional, HoverEventSource<HoverEvent.ShowEntity>, Leashable, LivingEntity, Lootable, Metadatable, Mob, Nameable, Permissible, PersistentDataHolder, PersistentDataViewHolder, Pointered, ProjectileSource, ServerOperator, Sound.Emitter
All Known Subinterfaces:
AbstractCow, AbstractHorse, AbstractNautilus, AbstractVillager, Animals, Armadillo, Axolotl, Bee, Breedable, Camel, CamelHusk, Cat, ChestedHorse, Chicken, Cow, Dolphin, Donkey, Drowned, Fox, Frog, GlowSquid, Goat, HappyGhast, Hoglin, Horse, Husk, Llama, Mule, MushroomCow, Nautilus, Ocelot, Panda, Parrot, Pig, Piglin, PiglinAbstract, PiglinBrute, PigZombie, PolarBear, Rabbit, Sheep, SkeletonHorse, Sniffer, Squid, Steerable, Strider, Tameable, TraderLlama, Turtle, Villager, WanderingTrader, Wolf, Zoglin, Zombie, ZombieHorse, ZombieNautilus, ZombieVillager

public interface Ageable extends Creature
Represents an entity that can age.
  • Method Details

    • getAge

      int getAge()
      Gets the age of this creature.
      Returns:
      Age
    • setAge

      void setAge(int age)
      Sets the age of this creature.
      Parameters:
      age - New age
    • setAgeLock

      void setAgeLock(boolean lock)
      Lock the age of the creature, setting this will prevent the creature from maturing or getting ready for mating. Plugins can still increase the age manually, however.
      Parameters:
      lock - new lock state
    • getAgeLock

      boolean getAgeLock()
      Checks if the age of the creature is locked.
      Returns:
      the current lock state
      See Also:
    • setBaby

      void setBaby()
      Transforms this creature to its baby counter-part.

      This will not have any effect if the creature is already in this state.

      See Also:
      API Note:
      some of them cannot be represented as such, so it's wise to check if isAdult() returns false after this method for general purpose use.
    • setAdult

      void setAdult()
      Transforms this creature to its adult counter-part.

      This will not have any effect if the creature is already in this state.

      See Also:
    • isAdult

      boolean isAdult()
      Returns true if the creature is an adult.
      Returns:
      if the creature is an adult
      See Also:
    • canBreed

      @Deprecated(since="1.16.2") boolean canBreed()
      Deprecated.
      Return the ability to breed of the creature.
      Returns:
      the ability to breed of the creature
    • setBreed

      @Deprecated(since="1.16.2") void setBreed(boolean breed)
      Set breedability of the creature, if the creature is a baby and set to breed it will instantly grow up.
      Parameters:
      breed - breedability of the creature