Package com.ticxo.modelengine.api.entity
Class Dummy
java.lang.Object
com.ticxo.modelengine.api.entity.Dummy
- All Implemented Interfaces:
BaseEntity<Object>
Default implementation of
This is mainly used to spawn player-specific models, inanimate objects, or extended to implement custom logic.
Since this wrapper does not exist in the world, it would not automatically add or remove players from the list of viewers. Use
BaseEntity
that does not wrap anything and have all aspects controllable.This is mainly used to spawn player-specific models, inanimate objects, or extended to implement custom logic.
Since this wrapper does not exist in the world, it would not automatically add or remove players from the list of viewers. Use
ManualRangeManager
to modify the viewer list.-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionDo not use this constructor unless you know what you are doing.
UseModelEngineAPI.createDummy()
orModelEngineAPI.createDummy(UUID)
instead. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Called when the target becomes invisible.
For bukkit entities and players, useEntityHandler.broadcastDespawnPacket(BaseEntity, boolean)
void
Called when the target becomes visible again.
For bukkit entities and players, useEntityHandler.broadcastSpawnPacket(BaseEntity, boolean)
org.bukkit.inventory.ItemStack
getItemInSlot
(org.bukkit.inventory.EquipmentSlot slot) Get the wrapped target.Get the step height of this entity.org.bukkit.World
getWorld()
Get the world of this entity.boolean
onHurt
(IDamageSource damageSource, float damage) Called when a sub-hitbox of this entity detects an attack.
For default bukkit behavior, useEntityHandler.hurt(Entity, IDamageSource, float)
.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, useEntityHandler.interact(Entity, Player, EquipmentSlot)
.void
onInteractAt
(org.bukkit.entity.Player player, org.bukkit.inventory.EquipmentSlot hand, org.bukkit.util.Vector position) void
setCollidableToLiving
(org.bukkit.entity.LivingEntity living, boolean flag) Configure whether the targeted living entity can collide with this entityvoid
Set the hitbox of this entity.
For bukkit entities, useEntityHandler.setHitbox(Entity, Hitbox)
.void
setStepHeight
(double height) Set the step height of this entity.
For bukkit entities, useEntityHandler.setStepHeight(Entity, double)
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)
.void
Patch 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, wait
Methods inherited from interface com.ticxo.modelengine.api.entity.BaseEntity
getEntityId, getHitbox, getLocation, getModelHitbox, getPassengers, getRangeManager, getUniqueId, getXHeadRot, getYBodyRot, getYHeadRot, isDead, isGlowing, isMoving, isOnGround, setYBodyRot, setYHeadRot
-
Constructor Details
-
Dummy
Do not use this constructor unless you know what you are doing.
UseModelEngineAPI.createDummy()
orModelEngineAPI.createDummy(UUID)
instead.
-
-
Method Details
-
getOriginal
Description copied from interface:BaseEntity
Get the wrapped target.- Specified by:
getOriginal
in interfaceBaseEntity<Object>
-
wrapMoveControl
Description copied from interface:BaseEntity
Create a wrapper for the movement control of this entity.
For bukkit entities, wrap withEntityHandler.wrapMoveControl(Entity)
.- Specified by:
wrapMoveControl
in interfaceBaseEntity<Object>
-
wrapLookControl
Description copied from interface:BaseEntity
Create a wrapper for the look control of this entity.
For bukkit entities, wrap withEntityHandler.wrapLookControl(Entity)
.- Specified by:
wrapLookControl
in interfaceBaseEntity<Object>
-
wrapBodyRotationControl
Description copied from interface:BaseEntity
Create a wrapper for the body rotation control of this entity.
For bukkit entities, wrap withEntityHandler.wrapBodyRotationControl(Entity)
.- Specified by:
wrapBodyRotationControl
in interfaceBaseEntity<Object>
-
wrapRangeManager
Description copied from interface:BaseEntity
Create a wrapper for the render range manager of this entity.
For bukkit entities, wrap withEntityHandler.wrapRangeManager(Entity)
.- Specified by:
wrapRangeManager
in interfaceBaseEntity<Object>
-
onHurt
Description copied from interface:BaseEntity
Called when a sub-hitbox of this entity detects an attack.
For default bukkit behavior, useEntityHandler.hurt(Entity, IDamageSource, float)
.- Specified by:
onHurt
in interfaceBaseEntity<Object>
- 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:BaseEntity
Called when a sub-hitbox of this entity detects an interaction.
For default bukkit behavior, useEntityHandler.interact(Entity, Player, EquipmentSlot)
.- Specified by:
onInteract
in interfaceBaseEntity<Object>
- Parameters:
player
- the triggerhand
- hand used to interact
-
onInteractAt
public void onInteractAt(org.bukkit.entity.Player player, org.bukkit.inventory.EquipmentSlot hand, org.bukkit.util.Vector position) -
setHitbox
Description copied from interface:BaseEntity
Set the hitbox of this entity.
For bukkit entities, useEntityHandler.setHitbox(Entity, Hitbox)
.- Specified by:
setHitbox
in interfaceBaseEntity<Object>
-
setStepHeight
public void setStepHeight(double height) Description copied from interface:BaseEntity
Set the step height of this entity.
For bukkit entities, useEntityHandler.setStepHeight(Entity, double)
- Specified by:
setStepHeight
in interfaceBaseEntity<Object>
- Parameters:
height
- height in blocks
-
getStepHeight
Description copied from interface:BaseEntity
Get the step height of this entity.- Specified by:
getStepHeight
in interfaceBaseEntity<Object>
- Returns:
- the step height, or null if it could not be determined.
-
setCollidableToLiving
public void setCollidableToLiving(org.bukkit.entity.LivingEntity living, boolean flag) Description copied from interface:BaseEntity
Configure whether the targeted living entity can collide with this entity- Specified by:
setCollidableToLiving
in interfaceBaseEntity<Object>
- Parameters:
living
- The targeted living entityflag
- Can be collided
-
broadcastSpawnPacket
public void broadcastSpawnPacket()Description copied from interface:BaseEntity
Called when the target becomes visible again.
For bukkit entities and players, useEntityHandler.broadcastSpawnPacket(BaseEntity, boolean)
- Specified by:
broadcastSpawnPacket
in interfaceBaseEntity<Object>
-
broadcastDespawnPacket
public void broadcastDespawnPacket()Description copied from interface:BaseEntity
Called when the target becomes invisible.
For bukkit entities and players, useEntityHandler.broadcastDespawnPacket(BaseEntity, boolean)
- Specified by:
broadcastDespawnPacket
in interfaceBaseEntity<Object>
-
getWorld
public org.bukkit.World getWorld()Description copied from interface:BaseEntity
Get the world of this entity.- Specified by:
getWorld
in interfaceBaseEntity<Object>
-
getItemInSlot
public org.bukkit.inventory.ItemStack getItemInSlot(org.bukkit.inventory.EquipmentSlot slot) - Specified by:
getItemInSlot
in interfaceBaseEntity<Object>
-