Class BoundingBoxTrait

java.lang.Object
net.citizensnpcs.api.trait.Trait
net.citizensnpcs.trait.BoundingBoxTrait
All Implemented Interfaces:
Runnable, Supplier<BoundingBox>, Listener

public class BoundingBoxTrait extends Trait implements Supplier<BoundingBox>
  • Constructor Details

    • BoundingBoxTrait

      public BoundingBoxTrait()
  • Method Details

    • get

      public BoundingBox get()
      Specified by:
      get in interface Supplier<BoundingBox>
    • getAdjustedDimensions

      public EntityDim getAdjustedDimensions()
    • onDespawn

      public void onDespawn()
      Description copied from class: Trait
      Called just before the attached NPC is despawned. NPC.getEntity() will be non-null.
      Overrides:
      onDespawn in class Trait
    • onRemove

      public void onRemove()
      Description copied from class: Trait
      Called when a trait is removed from the attached NPC.
      Overrides:
      onRemove in class Trait
    • onSpawn

      public void onSpawn()
      Description copied from class: Trait
      Called when an NPC is spawned. NPC.getEntity() will return null until this is called. This is also called onAttach when the NPC is already spawned.
      Overrides:
      onSpawn in class Trait
    • run

      public void run()
      Description copied from class: Trait
      Called every tick if overridden.
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Trait
    • setBoundingBoxFunction

      public void setBoundingBoxFunction(Function<EntityDim,BoundingBox> func)
    • setHeight

      public void setHeight(float height)
    • setScale

      public void setScale(float scale)
    • setWidth

      public void setWidth(float width)