Interface Ageable

All Superinterfaces:
Entity, HoverEventSource<HoverEvent.ShowEntity>, LivingEntity, Mob, SchedulerSource, Sound.Emitter, Sound.Source.Provider
All Known Subinterfaces:
Animal, Chicken, Cow, CubeMob, MagmaCube, Mooshroom, Pig, Sheep, Slime, SulfurCube

public interface Ageable extends Mob
A mob that is born a baby and grows up: farm animals among others.

Its age counts in ticks: negative while it is a baby, rising to 0 as it grows up; positive for an adult that has just bred, falling to 0 before it may breed again.

Like every entity, change it from the region thread owning its chunk.

Since:
0.1.0
  • Field Details

    • BABY_START_AGE

      static final int BABY_START_AGE
      How old a newborn baby is: it grows up after 24000 ticks, a full day.
      Since:
      0.1.0
      See Also:
  • Method Details

    • isBaby

      boolean isBaby()
      Returns true while this mob is a baby.
      Returns:
      true while this mob is a baby
      Since:
      0.1.0
    • setBaby

      void setBaby(boolean baby)
      Makes this mob a newborn baby, or an adult ready to breed.
      Parameters:
      baby - true for a baby
      Since:
      0.1.0
    • age

      int age()
      Returns the age of this mob in ticks.: negative while it is a baby, positive while it cannot breed again, 0 otherwise
      Returns:
      the age of this mob in ticks
      Since:
      0.1.0
    • setAge

      void setAge(int age)
      Changes the age of this mob; a negative age makes it a baby.
      Parameters:
      age - the new age, in ticks
      Since:
      0.1.0
    • isAgeLocked

      boolean isAgeLocked()
      Returns true if this baby stopped growing up., as one fed a golden dandelion does
      Returns:
      true if this baby stopped growing up
      Since:
      0.1.0
    • setAgeLocked

      void setAgeLocked(boolean ageLocked)
      Stops this baby from growing up, or lets it grow again.
      Parameters:
      ageLocked - true to stop it
      Since:
      0.1.0