Package net.citizensnpcs.api.trait.trait
Class Spawned
java.lang.Object
net.citizensnpcs.api.trait.Trait
net.citizensnpcs.api.trait.trait.Spawned
Represents the spawn state of an NPC. This only determines whether an NPC should spawn onEnable. For checking if an
NPC's entity is spawned, use NPC.isSpawned().
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Loads a trait.void
Saves a trait.void
setSpawned
(boolean shouldSpawn) Sets whether an NPC should spawn during server starts or reloads.boolean
Gets whether an NPC should spawn during server starts or reloads.toString()
-
Constructor Details
-
Spawned
public Spawned()
-
-
Method Details
-
load
Description copied from class:Trait
Loads a trait.- Overrides:
load
in classTrait
- Parameters:
key
- DataKey to load from- Throws:
NPCLoadException
- Thrown if this trait failed to load properly
-
save
Description copied from class:Trait
Saves a trait. -
setSpawned
public void setSpawned(boolean shouldSpawn) Sets whether an NPC should spawn during server starts or reloads.- Parameters:
shouldSpawn
- Whether an NPC should spawn
-
shouldSpawn
public boolean shouldSpawn()Gets whether an NPC should spawn during server starts or reloads.- Returns:
- Whether an NPC should spawn
-
toString
-