Package net.citizensnpcs.trait
Class BehaviorTrait
java.lang.Object
net.citizensnpcs.api.trait.Trait
net.citizensnpcs.trait.BehaviorTrait
Trait that allows NPCs to have behavior trees.
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanapplyBehaviorsFromFile(File file) voidstatic TraitTemplateParserCreates a template parser for BehaviorTrait that supports: Short form: "tree.yml" - loads tree from file Long form: tree as childvoidLoads a trait.voidCalled just before the attachedNPCis despawned.voidSaves a trait.
-
Constructor Details
-
BehaviorTrait
public BehaviorTrait()
-
-
Method Details
-
applyBehaviorsFromFile
-
applyBehaviorsFromKey
-
getMemory
- Returns:
- the blackboard memory for this NPC's behavior tree
-
load
Description copied from class:TraitLoads a trait. -
onDespawn
public void onDespawn()Description copied from class:TraitCalled just before the attachedNPCis despawned.NPC.getEntity()will be non-null. -
save
Description copied from class:TraitSaves a trait. -
createTemplateParser
Creates a template parser for BehaviorTrait that supports:- Short form: "tree.yml" - loads tree from file
- Long form: tree as child
-