Class Age

All Implemented Interfaces:
Runnable, Toggleable, Listener

public class Age extends Trait implements Toggleable
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.
      Specified by:
      toggle in interface Toggleable
    • toString

      public String toString()
      Overrides:
      toString in class Object