Package noppes.npcs.api.entity
Interface IEntityLivingBase<T extends net.minecraft.entity.EntityLivingBase>
-
- All Superinterfaces:
IEntity<T>
- All Known Subinterfaces:
IAnimal<T>
,ICustomNpc<T>
,IDBCPlayer
,IEntityLiving<T>
,IMonster<T>
,IPixelmon<T>
,IPlayer<T>
,IVillager<T>
public interface IEntityLivingBase<T extends net.minecraft.entity.EntityLivingBase> extends IEntity<T>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addPotionEffect(int effect, int duration, int strength, boolean hideParticles)
Works the same as the /effect commandboolean
canBreatheUnderwater()
boolean
canSeeEntity(IEntity entity)
void
clearPotionEffects()
Clears all potion effectsvoid
dismountEntity(IEntity entity)
float
getAbsorptionAmount()
float
getAIMoveSpeed()
IItemStack
getArmor(int slot)
Note not all Living Entities support thisint
getArrowCountInEntity()
IEntityLivingBase
getAttackTarget()
int
getAttackTargetTime()
double
getFollowRange()
float
getHealth()
IItemStack
getHeldItem()
Note not all Living Entities support thisdouble
getKnockbackResistance()
IEntity
getLastAttacker()
int
getLastAttackerTime()
IBlock
getLookingAtBlock(int maxDistance)
IBlock
getLookingAtBlock(int maxDistance, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision)
IEntity[]
getLookingAtEntities(int maxDistance, double offset, double range)
IEntity[]
getLookingAtEntities(int maxDistance, double offset, double range, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision)
IEntity[]
getLookingAtEntities(IEntity[] ignoreEntities, int maxDistance, double offset, double range, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision)
IPos
getLookingAtPos(int maxDistance)
Returns an IPos object corresponding to the final obstructed point following along the entity's look vector.IPos
getLookingAtPos(int maxDistance, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision)
IPos
getLookVector()
double
getMaxHealth()
T
getMCEntity()
Expert use onlydouble
getMeleeStrength()
int
getPotionEffect(int effect)
double
getSpeed()
int
getTotalArmorValue()
int
getType()
void
hurt(float damage)
void
hurt(float damage, IEntity source)
void
hurt(float damage, IDamageSource damageSource)
boolean
isAttacking()
boolean
isChild()
boolean
isOnLadder()
void
renderBrokenItemStack(IItemStack itemStack)
void
setAbsorptionAmount(float amount)
void
setAIMoveSpeed(float speed)
void
setArmor(int slot, IItemStack item)
Note not all Living Entities support thisvoid
setArrowCountInEntity(int count)
void
setAttackTarget(IEntityLivingBase living)
void
setFollowRange(double range)
void
setHealth(float health)
void
setHeldItem(IItemStack item)
Note not all Living Entities support thisvoid
setKnockbackResistance(double knockbackResistance)
void
setLastAttacker(IEntity p_130011_1_)
void
setMaxHealth(double health)
int
setMaxHurtTime()
void
setMaxHurtTime(int time)
void
setMeleeStrength(double attackDamage)
void
setSpeed(double speed)
void
swingHand()
Makes the entity swing its handboolean
typeOf(int type)
-
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
-
-
-
-
Method Detail
-
getHealth
float getHealth()
- Returns:
- The entity's current health
-
setHealth
void setHealth(float health)
- Parameters:
health
- The new health of this entity
-
hurt
void hurt(float damage)
-
hurt
void hurt(float damage, IEntity source)
-
hurt
void hurt(float damage, IDamageSource damageSource)
-
setMaxHurtTime
void setMaxHurtTime(int time)
-
setMaxHurtTime
int setMaxHurtTime()
-
getMaxHealth
double getMaxHealth()
- Returns:
- Entity's max health
-
getFollowRange
double getFollowRange()
-
getKnockbackResistance
double getKnockbackResistance()
-
getSpeed
double getSpeed()
-
getMeleeStrength
double getMeleeStrength()
-
setMaxHealth
void setMaxHealth(double health)
-
setFollowRange
void setFollowRange(double range)
-
setKnockbackResistance
void setKnockbackResistance(double knockbackResistance)
-
setSpeed
void setSpeed(double speed)
-
setMeleeStrength
void setMeleeStrength(double attackDamage)
-
isAttacking
boolean isAttacking()
- Returns:
- Whether or not this entity is attacking something
-
setAttackTarget
void setAttackTarget(IEntityLivingBase living)
- Parameters:
living
- Entity which this entity will attack
-
getAttackTarget
IEntityLivingBase getAttackTarget()
- Returns:
- The entity which this entity is attacking
-
getAttackTargetTime
int getAttackTargetTime()
-
setLastAttacker
void setLastAttacker(IEntity p_130011_1_)
-
getLastAttacker
IEntity getLastAttacker()
-
getLastAttackerTime
int getLastAttackerTime()
-
canBreatheUnderwater
boolean canBreatheUnderwater()
-
getType
int getType()
-
typeOf
boolean typeOf(int type)
-
canSeeEntity
boolean canSeeEntity(IEntity entity)
- Parameters:
entity
- Entity to check- Returns:
- Whether or not this entity can see the given entity
-
getLookVector
IPos getLookVector()
- Returns:
- Returns the look vector of this entity as an IPos object.
-
getLookingAtBlock
IBlock getLookingAtBlock(int maxDistance, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision)
-
getLookingAtBlock
IBlock getLookingAtBlock(int maxDistance)
- Parameters:
maxDistance
- The max distance to perform checks before stopping- Returns:
- The first block found by following along the entity's look vector.
-
getLookingAtPos
IPos getLookingAtPos(int maxDistance, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision)
-
getLookingAtPos
IPos getLookingAtPos(int maxDistance)
Returns an IPos object corresponding to the final obstructed point following along the entity's look vector. If no obstructions are found (entity is looking in a straight path of air with no blocks in the way), the final position is returned.- Parameters:
maxDistance
- The max distance to perform checks before stopping- Returns:
- The position the entity is looking at.
-
getLookingAtEntities
IEntity[] getLookingAtEntities(IEntity[] ignoreEntities, int maxDistance, double offset, double range, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision)
- Parameters:
maxDistance
- The max distance to perform checks before stoppingrange
- The radius to check for surrounding entities at every point on the vector- Returns:
- A list of entities, sorted first by closest to the entity along the look vector, then by which entities are closest to the vector.
-
getLookingAtEntities
IEntity[] getLookingAtEntities(int maxDistance, double offset, double range, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision)
-
getLookingAtEntities
IEntity[] getLookingAtEntities(int maxDistance, double offset, double range)
-
getMCEntity
T getMCEntity()
Expert use only- Specified by:
getMCEntity
in interfaceIEntity<T extends net.minecraft.entity.EntityLivingBase>
- Returns:
- Returns the minecraft entity object
-
swingHand
void swingHand()
Makes the entity swing its hand
-
addPotionEffect
void addPotionEffect(int effect, int duration, int strength, boolean hideParticles)
Works the same as the /effect command- Parameters:
effect
-duration
- The duration in secondsstrength
- The amplifier of the potion effecthideParticles
- Whether or not you want to hide potion particles
-
clearPotionEffects
void clearPotionEffects()
Clears all potion effects
-
getPotionEffect
int getPotionEffect(int effect)
- Parameters:
effect
- Potion effect to check- Returns:
- Returns -1 if its not active. Otherwise returns the strenght of the potion
- Since:
- 1.7.10c
-
getHeldItem
IItemStack getHeldItem()
Note not all Living Entities support this- Returns:
- The item the entity is holding
- Since:
- 1.7.10c
-
setHeldItem
void setHeldItem(IItemStack item)
Note not all Living Entities support this- Parameters:
item
- The item to be set- Since:
- 1.7.10c
-
getArmor
IItemStack getArmor(int slot)
Note not all Living Entities support this- Parameters:
slot
- Slot of what armor piece to get, 0:boots, 1:pants, 2:body, 3:head- Returns:
- The item in the given slot
-
setArmor
void setArmor(int slot, IItemStack item)
Note not all Living Entities support this- Parameters:
slot
- Slot of what armor piece to set, 0:boots, 1:pants, 2:body, 3:headitem
- Item to be set- Since:
- 1.7.10c
-
isChild
boolean isChild()
-
renderBrokenItemStack
void renderBrokenItemStack(IItemStack itemStack)
-
isOnLadder
boolean isOnLadder()
-
getTotalArmorValue
int getTotalArmorValue()
-
getArrowCountInEntity
int getArrowCountInEntity()
-
setArrowCountInEntity
void setArrowCountInEntity(int count)
-
dismountEntity
void dismountEntity(IEntity entity)
-
setAIMoveSpeed
void setAIMoveSpeed(float speed)
-
getAIMoveSpeed
float getAIMoveSpeed()
-
setAbsorptionAmount
void setAbsorptionAmount(float amount)
-
getAbsorptionAmount
float getAbsorptionAmount()
-
-