public abstract class EntityController<T extends CommonEntity<?>> extends CommonEntityController<T>
entity
Constructor and Description |
---|
EntityController() |
Modifier and Type | Method and Description |
---|---|
void |
bind(CommonEntity<?> entity,
boolean handleAttachment)
Binds this Entity Controller to an Entity.
|
String |
getLocalizedName()
Gets the localized name of this Entity.
|
boolean |
isPlayerTakable()
Gets whether this Entity Controller allows players to take this Entity
with them.
|
boolean |
onBlockCollision(org.bukkit.block.Block block,
org.bukkit.block.BlockFace hitFace)
Handles the collision of this minecart with a Block
|
void |
onBurnDamage(double damage)
Fired when the entity is getting burned by something
|
boolean |
onDamage(DamageSource damageSource,
double damage)
Called when the entity is damaged by something
|
void |
onDie()
Called when this Entity dies (could be called more than one time)
|
boolean |
onEntityCollision(org.bukkit.entity.Entity e)
Handles the collision of this minecart with another Entity
|
boolean |
onInteractBy(org.bukkit.entity.HumanEntity interacter,
HumanHand hand)
Called when the entity is interacted by something
|
void |
onItemSet(int index,
org.bukkit.inventory.ItemStack item)
Called when an item in the inventory changes, if the entity has an inventory
|
void |
onMove(MoveType moveType,
double dx,
double dy,
double dz)
Performs Entity movement logic, to move the Entity and handle collisions
|
void |
onPush(double dx,
double dy,
double dz) |
void |
onTick()
Called every tick to update the entity
|
void |
setBlockCollisionBounds(org.bukkit.util.Vector bounds)
Sets custom axis-aligned bounding box x/y/z size dimensions when handling block
collisions.
|
void |
setBlockCollisionEnabled(boolean enabled)
Sets whether block collisions are handled during movement of the entity.
|
void |
setEntityCollisionEnabled(boolean enabled)
Sets whether entity collisions are handled during movement of the entity.
|
getEntity, onAttached, onDetached
public final void bind(CommonEntity<?> entity, boolean handleAttachment)
entity
- to bind withhandleAttachment
- whether to fire CommonEntityController.onAttached()
public void onDie()
public void onTick()
onTick
in interface Tickable
onTick
in class CommonEntityController<T extends CommonEntity<?>>
public boolean onInteractBy(org.bukkit.entity.HumanEntity interacter, HumanHand hand)
interacter
- that interactedhand
- that is usedpublic boolean onDamage(DamageSource damageSource, double damage)
damageSource
- of the damagedamage
- amountpublic boolean onEntityCollision(org.bukkit.entity.Entity e)
e
- entity with which is collidedpublic boolean onBlockCollision(org.bukkit.block.Block block, org.bukkit.block.BlockFace hitFace)
block
- with which this minecart collidedhitFace
- of the block that the minecart hitpublic void onBurnDamage(double damage)
damage
- dealtpublic boolean isPlayerTakable()
public String getLocalizedName()
public void onPush(double dx, double dy, double dz)
public void onMove(MoveType moveType, double dx, double dy, double dz)
moveType
- mode of movingdx
- offset to movedy
- offset to movedz
- offset to movepublic void onItemSet(int index, org.bukkit.inventory.ItemStack item)
index
- of the itemitem
- it was set topublic void setBlockCollisionEnabled(boolean enabled)
enabled
- public void setEntityCollisionEnabled(boolean enabled)
enabled
- public void setBlockCollisionBounds(org.bukkit.util.Vector bounds)
bounds
- size vector to set to, null for defaultsCopyright © 2019. All rights reserved.