Class MountTrait

java.lang.Object
net.citizensnpcs.api.trait.Trait
net.citizensnpcs.trait.MountTrait
All Implemented Interfaces:
Runnable, Listener

public class MountTrait extends Trait
Persists the NPC's mounted on entity, if any. Will attempt to respawn on mount.
  • Constructor Details

    • MountTrait

      public MountTrait()
  • Method Details

    • checkMounted

      public void checkMounted()
    • getMountedOn

      public UUID getMountedOn()
    • onDespawn

      public void onDespawn()
      Description copied from class: Trait
      Called just before the attached NPC is despawned. NPC.getEntity() will be non-null.
      Overrides:
      onDespawn in class Trait
    • onRemove

      public void onRemove()
      Description copied from class: Trait
      Called when a trait is removed from the attached NPC.
      Overrides:
      onRemove 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
    • setMountedOn

      public void setMountedOn(UUID uuid)
    • unmount

      public void unmount()