Package noppes.npcs.api.entity
Interface IEntityLiving<T extends net.minecraft.entity.EntityLiving>
-
- Type Parameters:
T
- The underlying Minecraft EntityLiving type.
- All Superinterfaces:
IEntity<T>
,IEntityLivingBase<T>
- All Known Subinterfaces:
IAnimal<T>
,ICustomNpc<T>
,IMonster<T>
,IPixelmon<T>
,IVillager<T>
public interface IEntityLiving<T extends net.minecraft.entity.EntityLiving> extends IEntityLivingBase<T>
Represents a living entity (mob, NPC, etc.) that extends the base living functionality. Provides additional methods for navigation, sound, custom name, leashing, and more.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
allowLeashing()
boolean
canBeSteered()
boolean
canPickUpLoot()
void
clearLeashed(boolean sendPacket, boolean dropLeash)
Clears the entity's leash.void
clearNavigation()
Clears the current navigation path.void
enablePersistence()
Enables persistence so that the entity does not despawn.void
faceEntity(IEntity entity, float pitch, float yaw)
Rotates the entity to face the given entity.boolean
getAlwaysRenderNameTag()
java.lang.String
getCustomNameTag()
Returns the entity's custom name tag.boolean
getLeashed()
IEntity
getLeashedTo()
T
getMCEntity()
Returns the underlying Minecraft entity.boolean
hasCustomNameTag()
boolean
isNavigating()
Checks if the entity is currently navigating (pathfinding).boolean
isPersistent()
void
navigateTo(double x, double y, double z, double speed)
Commands the entity to navigate toward the specified destination.void
playLivingSound()
Plays the entity's living sound.void
setAlwaysRenderNameTag(boolean alwaysRender)
Sets whether the entity's name tag is always rendered.void
setCanPickUpLoot(boolean pickUp)
Sets whether the entity can pick up loot.void
setCustomNameTag(java.lang.String text)
Sets a custom name tag for the entity.void
setLeashedTo(IEntity entity, boolean sendPacket)
Leashes this entity to the specified entity.void
setMoveForward(float speed)
Sets the forward movement speed for the entity.void
spawnExplosionParticle()
Spawns explosion particles for this entity.-
Methods inherited from interface noppes.npcs.api.entity.IEntity
capturesDrops, clearStoredData, clearTempData, despawn, dropItem, extinguish, getAge, getAllNbt, getBlockX, getBlockY, getBlockZ, getCapturedDrops, getDimension, getEntityId, getHeight, getMotion, getMotionX, getMotionY, getMotionZ, getMount, getNbt, getNbtOptional, getPitch, getPosition, getRider, getRotation, getStoredData, getStoredDataKeys, getSurroundingEntities, getSurroundingEntities, getTempData, getTempDataKeys, getTypeName, getUniqueID, getWidth, getWorld, getX, getY, getYOffset, getZ, hasCollided, hasCollidedHorizontally, hasCollidedVertically, hasStoredData, hasTempData, inFire, inLava, inWater, isAirborne, isAlive, isBurning, isSneaking, isSprinting, knockback, knockback, knockback, removeStoredData, removeTempData, setBurning, setCapturedDrops, setCapturesDrops, setDimension, setImmune, setInvisible, setMotion, setMotion, setMotionX, setMotionY, setMotionZ, setMount, setNbt, setPitch, setPosition, setPosition, setRider, setRotation, setRotation, setSneaking, setSprinting, setStoredData, setTempData, setX, setY, setZ, spawnParticle, storeAsClone, updateEntity
-
Methods inherited from interface noppes.npcs.api.entity.IEntityLivingBase
addPotionEffect, canBreatheUnderwater, clearPotionEffects, dismountEntity, getAbsorptionAmount, getAIMoveSpeed, getArmor, getArrowCountInEntity, getAttackTarget, getAttackTargetTime, getFollowRange, getHealth, getHeldItem, getKnockbackResistance, getLastAttacker, getLastAttackerTime, getLookingAtBlock, getLookingAtBlock, getLookingAtEntities, getLookingAtEntities, getLookingAtEntities, getLookingAtPos, getLookingAtPos, getLookVector, getMaxHealth, getMaxHurtTime, getMeleeStrength, getPotionEffect, getSpeed, getTotalArmorValue, getType, hurt, hurt, hurt, isAttacking, isChild, isOnLadder, renderBrokenItemStack, setAbsorptionAmount, setAIMoveSpeed, setArmor, setArrowCountInEntity, setAttackTarget, setFollowRange, setHealth, setHeldItem, setKnockbackResistance, setLastAttacker, setMaxHealth, setMaxHurtTime, setMeleeStrength, setSpeed, swingHand, typeOf
-
-
-
-
Method Detail
-
isNavigating
boolean isNavigating()
Checks if the entity is currently navigating (pathfinding).- Returns:
- true if navigating; false otherwise.
-
clearNavigation
void clearNavigation()
Clears the current navigation path.
-
navigateTo
void navigateTo(double x, double y, double z, double speed)
Commands the entity to navigate toward the specified destination.- Parameters:
x
- Destination x coordinate.y
- Destination y coordinate.z
- Destination z coordinate.speed
- Movement speed (0.7 is default).
-
getMCEntity
T getMCEntity()
Returns the underlying Minecraft entity.- Specified by:
getMCEntity
in interfaceIEntity<T extends net.minecraft.entity.EntityLiving>
- Specified by:
getMCEntity
in interfaceIEntityLivingBase<T extends net.minecraft.entity.EntityLiving>
- Returns:
- the Minecraft entity.
-
playLivingSound
void playLivingSound()
Plays the entity's living sound.
-
spawnExplosionParticle
void spawnExplosionParticle()
Spawns explosion particles for this entity.
-
setMoveForward
void setMoveForward(float speed)
Sets the forward movement speed for the entity.- Parameters:
speed
- the forward speed.
-
faceEntity
void faceEntity(IEntity entity, float pitch, float yaw)
Rotates the entity to face the given entity.- Parameters:
entity
- the target entity.pitch
- the pitch angle.yaw
- the yaw angle.
-
canPickUpLoot
boolean canPickUpLoot()
- Returns:
- Whether the entity can pick up loot.
-
setCanPickUpLoot
void setCanPickUpLoot(boolean pickUp)
Sets whether the entity can pick up loot.- Parameters:
pickUp
- true to allow picking up loot.
-
isPersistent
boolean isPersistent()
- Returns:
- Whether the entity is persistent (won't despawn).
-
enablePersistence
void enablePersistence()
Enables persistence so that the entity does not despawn.
-
setCustomNameTag
void setCustomNameTag(java.lang.String text)
Sets a custom name tag for the entity.- Parameters:
text
- the custom name.
-
getCustomNameTag
java.lang.String getCustomNameTag()
Returns the entity's custom name tag.- Returns:
- the custom name.
-
hasCustomNameTag
boolean hasCustomNameTag()
- Returns:
- Whether the entity has a custom name tag.
-
setAlwaysRenderNameTag
void setAlwaysRenderNameTag(boolean alwaysRender)
Sets whether the entity's name tag is always rendered.- Parameters:
alwaysRender
- true to always render the name tag.
-
getAlwaysRenderNameTag
boolean getAlwaysRenderNameTag()
- Returns:
- Whether the name tag is always rendered.
-
clearLeashed
void clearLeashed(boolean sendPacket, boolean dropLeash)
Clears the entity's leash.- Parameters:
sendPacket
- whether to send a packet update.dropLeash
- whether to drop the leash item.
-
allowLeashing
boolean allowLeashing()
- Returns:
- Whether the entity allows leashing.
-
getLeashed
boolean getLeashed()
- Returns:
- Whether the entity is currently leashed.
-
getLeashedTo
IEntity getLeashedTo()
- Returns:
- The entity to which this entity is leashed.
-
setLeashedTo
void setLeashedTo(IEntity entity, boolean sendPacket)
Leashes this entity to the specified entity.- Parameters:
entity
- the entity to leash to.sendPacket
- whether to send a packet update.
-
canBeSteered
boolean canBeSteered()
- Returns:
- Whether the entity can be steered.
-
-