Package com.ticxo.modelengine.api.entity
Class BukkitEntity
java.lang.Object
com.ticxo.modelengine.api.entity.BukkitEntity
- All Implemented Interfaces:
BaseEntity<org.bukkit.entity.Entity>
Default implementation of
For simple usage, this is all you would need.
BaseEntity to wrap the default bukkit's Entity class.For simple usage, this is all you would need.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled when the target becomes invisible.
For bukkit entities and players, useEntityHandler.broadcastDespawnPacket(BaseEntity, boolean)voidCalled when the target becomes visible again.
For bukkit entities and players, useEntityHandler.broadcastSpawnPacket(BaseEntity, boolean)intGet 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.
UseEntityHandler.getEntityCounter()to generate unique integer ID if you are unsure.org.bukkit.inventory.ItemStackgetItemInSlot(org.bukkit.inventory.EquipmentSlot slot) org.bukkit.LocationGet the location of this entity.List<org.bukkit.entity.Entity>Get the UUID of this entity.
This UUID is used to retrieve the instance ofModeledEntityassociated with this entity.org.bukkit.WorldgetWorld()Get the world of this entity.floatfloatfloatbooleanisDead()booleanbooleanisMoving()booleanbooleanonHurt(IDamageSource damageSource, float damage) Called when a sub-hitbox of this entity detects an attack.
For default bukkit behavior, useEntityHandler.hurt(Entity, IDamageSource, float).voidonInteract(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, useEntityHandler.interact(Entity, Player, EquipmentSlot).voidsetCollidableToLiving(org.bukkit.entity.LivingEntity living, boolean isRemove) Configure whether the targeted living entity can collide with this entityvoidSet the hitbox of this entity.
For bukkit entities, useEntityHandler.setHitbox(Entity, Hitbox).voidsetStepHeight(double height) Set the step height of this entity.
For bukkit entities, useEntityHandler.setStepHeight(Entity, double)voidsetYBodyRot(float rot) voidsetYHeadRot(float rot) Create a wrapper for the body rotation control of this entity.
For bukkit entities, wrap withEntityHandler.wrapBodyRotationControl(Entity).Create a wrapper for the look control of this entity.
For bukkit entities, wrap withEntityHandler.wrapLookControl(Entity).Create a wrapper for the movement control of this entity.
For bukkit entities, wrap withEntityHandler.wrapMoveControl(Entity).voidPatch Minecraft's faulty pathfinding to accept different hitbox sizes.
For bukkit entities, wrap withEntityHandler.wrapNavigation(Entity).wrapRangeManager(IModel model) Create a wrapper for the render range manager of this entity.
For bukkit entities, wrap withEntityHandler.wrapRangeManager(Entity).Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.ticxo.modelengine.api.entity.BaseEntity
getHitbox, getModelHitbox, getOriginal, getRangeManager, getStepHeight
-
Constructor Details
-
BukkitEntity
public BukkitEntity(@NotNull @NotNull org.bukkit.entity.Entity entity)
-
-
Method Details
-
wrapMoveControl
Description copied from interface:BaseEntityCreate a wrapper for the movement control of this entity.
For bukkit entities, wrap withEntityHandler.wrapMoveControl(Entity).- Specified by:
wrapMoveControlin interfaceBaseEntity<org.bukkit.entity.Entity>
-
wrapLookControl
Description copied from interface:BaseEntityCreate a wrapper for the look control of this entity.
For bukkit entities, wrap withEntityHandler.wrapLookControl(Entity).- Specified by:
wrapLookControlin interfaceBaseEntity<org.bukkit.entity.Entity>
-
wrapBodyRotationControl
Description copied from interface:BaseEntityCreate a wrapper for the body rotation control of this entity.
For bukkit entities, wrap withEntityHandler.wrapBodyRotationControl(Entity).- Specified by:
wrapBodyRotationControlin interfaceBaseEntity<org.bukkit.entity.Entity>
-
wrapRangeManager
Description copied from interface:BaseEntityCreate a wrapper for the render range manager of this entity.
For bukkit entities, wrap withEntityHandler.wrapRangeManager(Entity).- Specified by:
wrapRangeManagerin interfaceBaseEntity<org.bukkit.entity.Entity>
-
onHurt
Description copied from interface:BaseEntityCalled when a sub-hitbox of this entity detects an attack.
For default bukkit behavior, useEntityHandler.hurt(Entity, IDamageSource, float).- Specified by:
onHurtin interfaceBaseEntity<org.bukkit.entity.Entity>- Parameters:
damageSource- the damage source of this attackdamage- raw damage before reduction- Returns:
- false to cancel the attack.
-
onInteract
public void onInteract(org.bukkit.entity.Player player, org.bukkit.inventory.EquipmentSlot hand) Description copied from interface:BaseEntityCalled when a sub-hitbox of this entity detects an interaction.
For default bukkit behavior, useEntityHandler.interact(Entity, Player, EquipmentSlot).- Specified by:
onInteractin interfaceBaseEntity<org.bukkit.entity.Entity>- Parameters:
player- the triggerhand- hand used to interact
-
setHitbox
Description copied from interface:BaseEntitySet the hitbox of this entity.
For bukkit entities, useEntityHandler.setHitbox(Entity, Hitbox).- Specified by:
setHitboxin interfaceBaseEntity<org.bukkit.entity.Entity>
-
setStepHeight
public void setStepHeight(double height) Description copied from interface:BaseEntitySet the step height of this entity.
For bukkit entities, useEntityHandler.setStepHeight(Entity, double)- Specified by:
setStepHeightin interfaceBaseEntity<org.bukkit.entity.Entity>- Parameters:
height- height in blocks
-
setCollidableToLiving
public void setCollidableToLiving(org.bukkit.entity.LivingEntity living, boolean isRemove) Description copied from interface:BaseEntityConfigure whether the targeted living entity can collide with this entity- Specified by:
setCollidableToLivingin interfaceBaseEntity<org.bukkit.entity.Entity>- Parameters:
living- The targeted living entityisRemove- Can be collided
-
broadcastSpawnPacket
public void broadcastSpawnPacket()Description copied from interface:BaseEntityCalled when the target becomes visible again.
For bukkit entities and players, useEntityHandler.broadcastSpawnPacket(BaseEntity, boolean)- Specified by:
broadcastSpawnPacketin interfaceBaseEntity<org.bukkit.entity.Entity>
-
broadcastDespawnPacket
public void broadcastDespawnPacket()Description copied from interface:BaseEntityCalled when the target becomes invisible.
For bukkit entities and players, useEntityHandler.broadcastDespawnPacket(BaseEntity, boolean)- Specified by:
broadcastDespawnPacketin interfaceBaseEntity<org.bukkit.entity.Entity>
-
getEntityId
public int getEntityId()Description copied from interface:BaseEntityGet 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.
UseEntityHandler.getEntityCounter()to generate unique integer ID if you are unsure.- Specified by:
getEntityIdin interfaceBaseEntity<org.bukkit.entity.Entity>
-
getUniqueId
Description copied from interface:BaseEntityGet the UUID of this entity.
This UUID is used to retrieve the instance ofModeledEntityassociated with this entity. SeeModelEngineAPI.getModeledEntity(UUID).- Specified by:
getUniqueIdin interfaceBaseEntity<org.bukkit.entity.Entity>
-
getLocation
public org.bukkit.Location getLocation()Description copied from interface:BaseEntityGet the location of this entity.- Specified by:
getLocationin interfaceBaseEntity<org.bukkit.entity.Entity>
-
getWorld
public org.bukkit.World getWorld()Description copied from interface:BaseEntityGet the world of this entity.- Specified by:
getWorldin interfaceBaseEntity<org.bukkit.entity.Entity>
-
isDead
public boolean isDead()- Specified by:
isDeadin interfaceBaseEntity<org.bukkit.entity.Entity>
-
isGlowing
public boolean isGlowing()- Specified by:
isGlowingin interfaceBaseEntity<org.bukkit.entity.Entity>
-
isOnGround
public boolean isOnGround()- Specified by:
isOnGroundin interfaceBaseEntity<org.bukkit.entity.Entity>
-
isMoving
public boolean isMoving()- Specified by:
isMovingin interfaceBaseEntity<org.bukkit.entity.Entity>
-
setYHeadRot
public void setYHeadRot(float rot) - Specified by:
setYHeadRotin interfaceBaseEntity<org.bukkit.entity.Entity>
-
getYHeadRot
public float getYHeadRot()- Specified by:
getYHeadRotin interfaceBaseEntity<org.bukkit.entity.Entity>
-
getXHeadRot
public float getXHeadRot()- Specified by:
getXHeadRotin interfaceBaseEntity<org.bukkit.entity.Entity>
-
setYBodyRot
public void setYBodyRot(float rot) - Specified by:
setYBodyRotin interfaceBaseEntity<org.bukkit.entity.Entity>
-
getYBodyRot
public float getYBodyRot()- Specified by:
getYBodyRotin interfaceBaseEntity<org.bukkit.entity.Entity>
-
getPassengers
- Specified by:
getPassengersin interfaceBaseEntity<org.bukkit.entity.Entity>
-
getItemInSlot
public org.bukkit.inventory.ItemStack getItemInSlot(org.bukkit.inventory.EquipmentSlot slot) - Specified by:
getItemInSlotin interfaceBaseEntity<org.bukkit.entity.Entity>
-