Class MobType

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

public class MobType extends Trait
Represents an NPC's mob type.
  • Constructor Details

    • MobType

      public MobType()
  • Method Details

    • getType

      public EntityType getType()
      Gets the type of mob that an NPC is.
      Returns:
      The mob type
    • 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
    • save

      public void save(DataKey key)
      Description copied from class: Trait
      Saves a trait.
      Overrides:
      save in class Trait
      Parameters:
      key - DataKey to save to
    • setType

      public void setType(EntityType type)
      Sets the type of mob that an NPC is.
      Parameters:
      type - Mob type to set the NPC as
    • toString

      public String toString()
      Overrides:
      toString in class Object