Interface BaseEntity<T>

All Known Implementing Classes:
BukkitEntity, BukkitPlayer, Dummy

public interface BaseEntity<T>
Interface used by ModeledEntity to retrieve information about the entity.
For bukkit entities, use BukkitEntity.
For bukkit players, use BukkitPlayer.
For general purpose player-specific targets, use Dummy.
  • Method Details

    • getOriginal

      T getOriginal()
      Get the wrapped target.
    • wrapMoveControl

      MoveController wrapMoveControl()
      Create a wrapper for the movement control of this entity.
      For bukkit entities, wrap with EntityHandler.wrapMoveControl(Entity).
    • wrapLookControl

      LookController wrapLookControl()
      Create a wrapper for the look control of this entity.
      For bukkit entities, wrap with EntityHandler.wrapLookControl(Entity).
    • wrapBodyRotationControl

      BodyRotationController wrapBodyRotationControl()
      Create a wrapper for the body rotation control of this entity.
      For bukkit entities, wrap with EntityHandler.wrapBodyRotationControl(Entity).
    • wrapNavigation

      void wrapNavigation()
      Patch Minecraft's faulty pathfinding to accept different hitbox sizes.
      For bukkit entities, wrap with EntityHandler.wrapNavigation(Entity).
    • wrapRangeManager

      RangeManager wrapRangeManager(IModel model)
      Create a wrapper for the render range manager of this entity.
      For bukkit entities, wrap with EntityHandler.wrapRangeManager(Entity).
    • getRangeManager

      RangeManager getRangeManager()
      Return the wrapped render range manager created in wrapRangeManager(IModel).
    • onHurt

      boolean onHurt(IDamageSource damageSource, float damage)
      Called when a sub-hitbox of this entity detects an attack.
      For default bukkit behavior, use EntityHandler.hurt(Entity, IDamageSource, float).
      Parameters:
      damageSource - the damage source of this attack
      damage - raw damage before reduction
      Returns:
      false to cancel the attack.
    • onInteract

      void onInteract(org.bukkit.entity.Player player, org.bukkit.inventory.EquipmentSlot hand)
      Called when a sub-hitbox of this entity detects an interaction.
      For default bukkit behavior, use EntityHandler.interact(Entity, Player, EquipmentSlot).
      Parameters:
      player - the trigger
      hand - hand used to interact
    • setHitbox

      void setHitbox(Hitbox hitbox)
      Set the hitbox of this entity.
      For bukkit entities, use EntityHandler.setHitbox(Entity, Hitbox).
    • getHitbox

      Hitbox getHitbox()
      Get the hitbox of this entity.
    • getModelHitbox

      ModelHitbox getModelHitbox()
    • setStepHeight

      void setStepHeight(double height)
      Set the step height of this entity.
      For bukkit entities, use EntityHandler.setStepHeight(Entity, double)
      Parameters:
      height - height in blocks
    • getStepHeight

      Double getStepHeight()
      Get the step height of this entity.
      Returns:
      the step height, or null if it could not be determined.
    • setCollidableToLiving

      void setCollidableToLiving(org.bukkit.entity.LivingEntity living, boolean isRemove)
      Configure whether the targeted living entity can collide with this entity
      Parameters:
      living - The targeted living entity
      isRemove - Can be collided
    • broadcastSpawnPacket

      void broadcastSpawnPacket()
      Called when the target becomes visible again.
      For bukkit entities and players, use EntityHandler.broadcastSpawnPacket(BaseEntity, boolean)
    • broadcastDespawnPacket

      void broadcastDespawnPacket()
      Called when the target becomes invisible.
      For bukkit entities and players, use EntityHandler.broadcastDespawnPacket(BaseEntity, boolean)
    • getEntityId

      int getEntityId()
      Get the entity ID of this entity.
      If the target is not a bukkit entity, you have to be absolutely sure that this ID does not overlap with an existing entity, as it is used to identify interactions between models.
      Use EntityHandler.getEntityCounter() to generate unique integer ID if you are unsure.
    • getUniqueId

      UUID getUniqueId()
      Get the UUID of this entity.
      This UUID is used to retrieve the instance of ModeledEntity associated with this entity. See ModelEngineAPI.getModeledEntity(UUID).
    • getLocation

      org.bukkit.Location getLocation()
      Get the location of this entity.
    • getWorld

      org.bukkit.World getWorld()
      Get the world of this entity.
    • isDead

      boolean isDead()
    • isGlowing

      boolean isGlowing()
    • isOnGround

      boolean isOnGround()
    • isMoving

      boolean isMoving()
    • setYHeadRot

      void setYHeadRot(float rot)
    • getYHeadRot

      float getYHeadRot()
    • getXHeadRot

      float getXHeadRot()
    • setYBodyRot

      void setYBodyRot(float rot)
    • getYBodyRot

      float getYBodyRot()
    • getPassengers

      List<org.bukkit.entity.Entity> getPassengers()
    • getItemInSlot

      org.bukkit.inventory.ItemStack getItemInSlot(org.bukkit.inventory.EquipmentSlot slot)