Package net.citizensnpcs.trait
Class BoundingBoxTrait
java.lang.Object
net.citizensnpcs.api.trait.Trait
net.citizensnpcs.trait.BoundingBoxTrait
- All Implemented Interfaces:
Runnable,Supplier<BoundingBox>,Listener
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget()voidCalled just before the attachedNPCis despawned.voidonRemove()Called when a trait is removed from the attachedNPC.voidonSpawn()Called when anNPCis spawned.voidrun()Called every tick if overridden.voidvoidsetHeight(float height) voidvoidsetScale(float scale) voidsetWidth(float width) Methods inherited from class net.citizensnpcs.api.trait.Trait
getName, getNPC, getTraitId, isRunImplemented, linkToNPC, load, onAttach, onCopy, onDespawn, onPreSpawn, onRemove, save
-
Constructor Details
-
BoundingBoxTrait
public BoundingBoxTrait()
-
-
Method Details
-
get
- Specified by:
getin interfaceSupplier<BoundingBox>
-
getAdjustedDimensions
-
onDespawn
public void onDespawn()Description copied from class:TraitCalled just before the attachedNPCis despawned.NPC.getEntity()will be non-null. -
onRemove
public void onRemove()Description copied from class:TraitCalled when a trait is removed from the attachedNPC. -
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. -
run
public void run()Description copied from class:TraitCalled every tick if overridden. -
setBoundingBoxFunction
-
setHeight
public void setHeight(float height) -
setOffset
-
setScale
public void setScale(float scale) -
setWidth
public void setWidth(float width)
-