Package noppes.npcs.api.entity
Interface IEntity<T extends net.minecraft.entity.Entity>
-
- All Known Subinterfaces:
IAnimal<T>
,ICustomNpc<T>
,IDBCPlayer
,IEntityItem<T>
,IEntityLiving<T>
,IEntityLivingBase<T>
,IMonster<T>
,IPixelmon<T>
,IPlayer<T>
,IVillager<T>
public interface IEntity<T extends net.minecraft.entity.Entity>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
capturesDrops()
void
clearStoredData()
Remove all stored datavoid
clearTempData()
Remove all tempdatavoid
despawn()
Despawns this entity.void
dropItem(IItemStack item)
void
extinguish()
Removes fire from this entitylong
getAge()
INbt
getAllNbt()
int
getBlockX()
int
getBlockY()
int
getBlockZ()
IEntity<?>[]
getCapturedDrops()
int
getDimension()
int
getEntityId()
double
getHeight()
T
getMCEntity()
IPos
getMotion()
double
getMotionX()
double
getMotionY()
double
getMotionZ()
IEntity
getMount()
INbt
getNbt()
INbt
getNbtOptional()
float
getPitch()
IPos
getPosition()
IEntity
getRider()
float
getRotation()
java.lang.Object
getStoredData(java.lang.String key)
java.lang.String[]
getStoredDataKeys()
IEntity[]
getSurroundingEntities(int range)
IEntity[]
getSurroundingEntities(int range, int type)
java.lang.Object
getTempData(java.lang.String key)
java.lang.String[]
getTempDataKeys()
int
getType()
java.lang.String
getTypeName()
java.lang.String
getUniqueID()
double
getWidth()
IWorld
getWorld()
double
getX()
double
getY()
double
getYOffset()
double
getZ()
boolean
hasCollided()
boolean
hasCollidedHorizontally()
boolean
hasCollidedVertically()
boolean
hasStoredData(java.lang.String key)
boolean
hasTempData(java.lang.String key)
boolean
inFire()
boolean
inLava()
boolean
inWater()
boolean
isAirborne()
boolean
isAlive()
boolean
isBurning()
boolean
isSneaking()
boolean
isSprinting()
void
knockback(double xpower, double ypower, double zpower, float direction)
void
knockback(int power, float direction)
void
knockback(IPos pos, float direction)
void
removeStoredData(java.lang.String key)
void
removeTempData(java.lang.String key)
void
setBurning(int ticks)
void
setCapturedDrops(IEntity<?>[] capturedDrops)
void
setCapturesDrops(boolean capture)
void
setDimension(int dimensionId)
void
setImmune(int ticks)
void
setInvisible(boolean invisible)
void
setMotion(double x, double y, double z)
void
setMotion(IPos pos)
void
setMotionX(double x)
void
setMotionY(double y)
void
setMotionZ(double z)
void
setMount(IEntity entity)
void
setNbt(INbt nbt)
void
setPitch(float pitch)
void
setPosition(double x, double y, double z)
void
setPosition(IPos pos)
void
setRider(IEntity entity)
void
setRotation(float rotation)
void
setRotation(float rotationYaw, float rotationPitch)
void
setSneaking(boolean sneaking)
void
setSprinting(boolean sprinting)
void
setStoredData(java.lang.String key, java.lang.Object value)
Stored data persists through world restart.void
setTempData(java.lang.String key, java.lang.Object value)
Tempdata gets cleared when the entity gets unloaded or the world restartsvoid
setX(double x)
void
setY(double y)
void
setZ(double z)
void
spawnParticle(IParticle entityParticle)
void
storeAsClone(int tab, java.lang.String name)
boolean
typeOf(int type)
void
updateEntity()
-
-
-
Method Detail
-
spawnParticle
void spawnParticle(IParticle entityParticle)
-
getEntityId
int getEntityId()
-
getUniqueID
java.lang.String getUniqueID()
-
getYOffset
double getYOffset()
-
getWidth
double getWidth()
- Returns:
- The entities width
-
getHeight
double getHeight()
- Returns:
- The entities height
-
getX
double getX()
- Returns:
- The entities x position
-
setX
void setX(double x)
- Parameters:
x
- The entities x position
-
getY
double getY()
- Returns:
- The entities y position
-
setY
void setY(double y)
- Parameters:
y
- The entities y position
-
getZ
double getZ()
- Returns:
- The entities x position
-
setZ
void setZ(double z)
- Parameters:
z
- The entities x position
-
getMotionX
double getMotionX()
- Returns:
- The entities z motion
-
setMotionX
void setMotionX(double x)
- Parameters:
x
- The entities x motion
-
getMotionY
double getMotionY()
- Returns:
- The entities x motion
-
setMotionY
void setMotionY(double y)
- Parameters:
y
- The entities y motion
-
getMotionZ
double getMotionZ()
- Returns:
- The entities y motion
-
setMotionZ
void setMotionZ(double z)
- Parameters:
z
- The entities z motion
-
setMotion
void setMotion(double x, double y, double z)
-
setMotion
void setMotion(IPos pos)
-
getMotion
IPos getMotion()
-
isAirborne
boolean isAirborne()
-
getBlockX
int getBlockX()
- Returns:
- The block x position
-
getBlockY
int getBlockY()
- Returns:
- The block y position
-
getBlockZ
int getBlockZ()
- Returns:
- The block z position
-
setPosition
void setPosition(double x, double y, double z)
- Parameters:
x
- The x positiony
- The y positionz
- The z position
-
setPosition
void setPosition(IPos pos)
-
getPosition
IPos getPosition()
-
getDimension
int getDimension()
-
setDimension
void setDimension(int dimensionId)
-
getSurroundingEntities
IEntity[] getSurroundingEntities(int range)
- Parameters:
range
- The search range for entities around this entity- Returns:
- Array of entities within range
-
getSurroundingEntities
IEntity[] getSurroundingEntities(int range, int type)
- Parameters:
range
- The search range for entities around this entitytype
- The EntityType you want to find- Returns:
- Array of entities within range
-
isAlive
boolean isAlive()
- Returns:
- Whether the entity is alive or not
-
getTempData
java.lang.Object getTempData(java.lang.String key)
- Parameters:
key
- Get temp data for this key- Returns:
- Returns the stored temp data
-
setTempData
void setTempData(java.lang.String key, java.lang.Object value)
Tempdata gets cleared when the entity gets unloaded or the world restarts- Parameters:
key
- The key for the data storedvalue
- The data stored
-
hasTempData
boolean hasTempData(java.lang.String key)
- Parameters:
key
- The key thats going to be tested against the temp data- Returns:
- Whether or not temp data containes the key
-
removeTempData
void removeTempData(java.lang.String key)
- Parameters:
key
- The key for the temp data to be removed
-
clearTempData
void clearTempData()
Remove all tempdata
-
getTempDataKeys
java.lang.String[] getTempDataKeys()
-
getStoredData
java.lang.Object getStoredData(java.lang.String key)
- Parameters:
key
- The key of the data to be returned- Returns:
- Returns the stored data
-
setStoredData
void setStoredData(java.lang.String key, java.lang.Object value)
Stored data persists through world restart. Unlike tempdata only Strings and Numbers can be saved- Parameters:
key
- The key for the data storedvalue
- The data stored. This data can be either a Number or a String. Other data is not stored
-
hasStoredData
boolean hasStoredData(java.lang.String key)
- Parameters:
key
- The key of the data to be checked- Returns:
- Returns whether or not the stored data contains the key
-
removeStoredData
void removeStoredData(java.lang.String key)
- Parameters:
key
- The key of the data to be removed
-
clearStoredData
void clearStoredData()
Remove all stored data
-
getStoredDataKeys
java.lang.String[] getStoredDataKeys()
-
getAge
long getAge()
- Returns:
- The age of this entity in ticks
-
despawn
void despawn()
Despawns this entity. Removes it permanently
-
inWater
boolean inWater()
- Returns:
- Return whether or not this entity is standing in water
-
inLava
boolean inLava()
- Returns:
- Return whether or not this entity is standing in lava
-
inFire
boolean inFire()
- Returns:
- Return whether or not this entity is standing in fire
-
isBurning
boolean isBurning()
- Returns:
- Return whether or not this entity is on fire
-
setBurning
void setBurning(int ticks)
- Parameters:
ticks
- Amount of world ticks this entity will burn. 20 ticks equals 1 second
-
extinguish
void extinguish()
Removes fire from this entity
-
getTypeName
java.lang.String getTypeName()
- Returns:
- Name as which it's registered in minecraft
-
dropItem
void dropItem(IItemStack item)
- Parameters:
item
- Item to be dropped
-
getRider
IEntity getRider()
- Returns:
- Return the rider
-
setRider
void setRider(IEntity entity)
- Parameters:
entity
- The entity to ride this entity
-
getMount
IEntity getMount()
- Returns:
- Return the entity, this entity is riding
-
setMount
void setMount(IEntity entity)
- Parameters:
entity
- The entity this entity will mount
-
getType
int getType()
- Returns:
- Returns the EntityType of this entity
- See Also:
EntityType
-
typeOf
boolean typeOf(int type)
- Parameters:
type
-- Returns:
- Returns whether the entity is type of the given @EntityType
- Since:
- 1.7.10c
-
setRotation
void setRotation(float rotation)
- Parameters:
rotation
- The rotation to be set (0-360)
-
setRotation
void setRotation(float rotationYaw, float rotationPitch)
-
getRotation
float getRotation()
- Returns:
- Current rotation of the npc
-
setPitch
void setPitch(float pitch)
-
getPitch
float getPitch()
-
knockback
void knockback(int power, float direction)
- Parameters:
power
- How strong the knockback isdirection
- The direction in which he flies back (0-360). Usually based on getRotation()
-
knockback
void knockback(double xpower, double ypower, double zpower, float direction)
-
knockback
void knockback(IPos pos, float direction)
-
setImmune
void setImmune(int ticks)
-
setInvisible
void setInvisible(boolean invisible)
-
setSneaking
void setSneaking(boolean sneaking)
-
setSprinting
void setSprinting(boolean sprinting)
-
hasCollided
boolean hasCollided()
-
hasCollidedVertically
boolean hasCollidedVertically()
-
hasCollidedHorizontally
boolean hasCollidedHorizontally()
-
capturesDrops
boolean capturesDrops()
-
setCapturesDrops
void setCapturesDrops(boolean capture)
-
setCapturedDrops
void setCapturedDrops(IEntity<?>[] capturedDrops)
-
getCapturedDrops
IEntity<?>[] getCapturedDrops()
-
isSneaking
boolean isSneaking()
- Returns:
- Returns whether or not this entity is sneaking
- Since:
- 1.7.10c
-
isSprinting
boolean isSprinting()
- Returns:
- Returns whether or not this entity is sprinting
- Since:
- 1.7.10c
-
getMCEntity
T getMCEntity()
- Returns:
- Returns minecrafts entity
- Since:
- 1.7.10c Expert users only
-
getNbt
INbt getNbt()
-
getAllNbt
INbt getAllNbt()
-
setNbt
void setNbt(INbt nbt)
-
getNbtOptional
INbt getNbtOptional()
-
storeAsClone
void storeAsClone(int tab, java.lang.String name)
-
getWorld
IWorld getWorld()
-
updateEntity
void updateEntity()
-
-