Class CurrentLocation

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

public class CurrentLocation extends Trait
Persists the current Location of the NPC. Will cache last known location if despawned.
  • Constructor Details

    • CurrentLocation

      public CurrentLocation()
  • Method Details

    • getBodyYaw

      public float getBodyYaw()
    • getLocation

      public Location getLocation()
    • load

      public void load(DataKey key)
      Description copied from class: Trait
      Loads a trait.
      Overrides:
      load in class Trait
      Parameters:
      key - DataKey to load from
    • 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
    • setLocation

      public void setLocation(Location loc)
    • toString

      public String toString()
      Overrides:
      toString in class Object