Package net.citizensnpcs.trait
Class VillagerProfession
java.lang.Object
net.citizensnpcs.api.trait.Trait
net.citizensnpcs.trait.VillagerProfession
Persists the Villager profession metadata.
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Loads a trait.void
onSpawn()
Called when anNPC
is spawned.void
Saves a trait.void
setProfession
(Villager.Profession profession) toString()
-
Constructor Details
-
VillagerProfession
public VillagerProfession()
-
-
Method Details
-
getProfession
-
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
-
onSpawn
public void onSpawn()Description copied from class:Trait
Called when anNPC
is spawned.NPC.getEntity()
will return null until this is called. This is also called onAttach when the NPC is already spawned. -
save
Description copied from class:Trait
Saves a trait. -
setProfession
-
toString
-