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 booleanallowLeashing()booleancanBeSteered()booleancanPickUpLoot()voidclearLeashed(boolean sendPacket, boolean dropLeash)Clears the entity's leash.voidclearNavigation()Clears the current navigation path.voidenablePersistence()Enables persistence so that the entity does not despawn.voidfaceEntity(IEntity entity, float pitch, float yaw)Rotates the entity to face the given entity.booleangetAlwaysRenderNameTag()java.lang.StringgetCustomNameTag()Returns the entity's custom name tag.booleangetLeashed()IEntitygetLeashedTo()TgetMCEntity()Returns the underlying Minecraft entity.booleanhasCustomNameTag()booleanisNavigating()Checks if the entity is currently navigating (pathfinding).booleanisPersistent()voidnavigateTo(double x, double y, double z, double speed)Commands the entity to navigate toward the specified destination.voidplayLivingSound()Plays the entity's living sound.voidsetAlwaysRenderNameTag(boolean alwaysRender)Sets whether the entity's name tag is always rendered.voidsetCanPickUpLoot(boolean pickUp)Sets whether the entity can pick up loot.voidsetCustomNameTag(java.lang.String text)Sets a custom name tag for the entity.voidsetLeashedTo(IEntity entity, boolean sendPacket)Leashes this entity to the specified entity.voidsetMoveForward(float speed)Sets the forward movement speed for the entity.voidspawnExplosionParticle()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:
getMCEntityin interfaceIEntity<T extends net.minecraft.entity.EntityLiving>- Specified by:
getMCEntityin 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.
-
-