Package net.citizensnpcs.trait
Class AttributeTrait
java.lang.Object
net.citizensnpcs.api.trait.Trait
net.citizensnpcs.trait.AttributeTrait
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAttributeValue(Attribute attribute) booleanhasAttribute(Attribute attribute) voidLoads a trait.voidonSpawn()Called when anNPCis spawned.voidresetToDefaultValue(Attribute attribute) voidsetAttributeValue(Attribute attribute, double value)
-
Constructor Details
-
AttributeTrait
public AttributeTrait()
-
-
Method Details
-
getAttributeValue
-
hasAttribute
-
load
Description copied from class:TraitLoads a trait.- Overrides:
loadin 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:TraitCalled when anNPCis spawned.NPC.getEntity()will return null until this is called. This is also called onAttach when the NPC is already spawned. -
setAttributeValue
-
resetToDefaultValue
-