Class Age

All Implemented Interfaces:
Runnable, Listener

public class Age extends Trait
Persists the Minecraft age variable for Ageables. Will also set baby for Zombies.
See Also:
  • Constructor Details

    • Age

      public Age()
  • Method Details

    • describe

      public void describe(CommandSender sender)
      Send a brief description of the current state of the trait to the supplied CommandSender.
    • getAge

      public int getAge()
    • onSpawn

      public void onSpawn()
      Description copied from class: Trait
      Called when an NPC is spawned. NPC.getEntity() will return null until this is called. This is also called onAttach when the NPC is already spawned.
      Overrides:
      onSpawn in class Trait
    • run

      public void run()
      Description copied from class: Trait
      Called every tick if overridden.
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Trait
    • setAge

      public void setAge(int age)
    • setLocked

      public void setLocked(boolean locked)
    • toggle

      public boolean toggle()
      Toggles the age lock variable and returns whether the age is currently locked.
    • toString

      public String toString()
      Overrides:
      toString in class Object