Package noppes.npcs.api.entity
Interface IEntity<T extends net.minecraft.entity.Entity>
- All Known Subinterfaces:
IAnimal<T>
,IArrow<T>
,ICustomNpc<T>
,IEntityItem<T>
,IEntityLiving<T>
,IEntityLivingBase<T>
,IMonster<T>
,IPixelmon<T>
,IPlayer<T>
,IProjectile<T>
,IThrowable<T>
,IVillager<T>
public interface IEntity<T extends net.minecraft.entity.Entity>
-
Method Summary
Modifier and Type Method Description void
addRider(IEntity entity)
void
addTag(java.lang.String tag)
void
clearRiders()
void
damage(float amount)
void
despawn()
Despawns this entity.IEntityItem
dropItem(IItemStack item)
void
extinguish()
Removes fire from this entityjava.lang.String
generateNewUUID()
long
getAge()
IEntity[]
getAllRiders()
int
getBlockX()
int
getBlockY()
int
getBlockZ()
java.lang.String
getEntityName()
INbt
getEntityNbt()
This is not a function you should be calling every tick.float
getEyeHeight()
float
getHeight()
T
getMCEntity()
Expert users onlydouble
getMotionX()
double
getMotionY()
double
getMotionZ()
IEntity
getMount()
java.lang.String
getName()
INbt
getNbt()
The Entity's extra stored NBT datafloat
getPitch()
IPos
getPos()
IEntity[]
getRiders()
float
getRotation()
IData
getStoreddata()
Stored data persists through world restart.java.lang.String[]
getTags()
Tags are used by scoreboards and can be used in commandsIData
getTempdata()
Temp data stores anything but only untill it's reloadedint
getType()
java.lang.String
getTypeName()
java.lang.String
getUUID()
float
getWidth()
IWorld
getWorld()
double
getX()
double
getY()
double
getZ()
boolean
hasCustomName()
boolean
hasTag(java.lang.String tag)
boolean
inFire()
boolean
inLava()
boolean
inWater()
boolean
isAlive()
boolean
isBurning()
boolean
isSneaking()
boolean
isSprinting()
void
kill()
Kill the entity, doesnt't despawn itvoid
knockback(int power, float direction)
void
playAnimation(int type)
Play specific minecraft animations client side 0 and 3 are for EntityLivingBase entities and 2 is only for playersIRayTrace
rayTraceBlock(double distance, boolean stopOnLiquid, boolean ignoreBlockWithoutBoundingBox)
Gets the first block within distance the npc is looking atIEntity[]
rayTraceEntities(double distance, boolean stopOnLiquid, boolean ignoreBlockWithoutBoundingBox)
Gets the entities within distance the npc is looking at sorted by distancevoid
removeTag(java.lang.String tag)
void
setBurning(int seconds)
void
setEntityNbt(INbt nbt)
This is not a function you should be calling every tickvoid
setMotionX(double motion)
void
setMotionY(double motion)
void
setMotionZ(double motion)
void
setMount(IEntity entity)
void
setName(java.lang.String name)
void
setPitch(float pitch)
void
setPos(IPos pos)
void
setPosition(double x, double y, double z)
void
setRotation(float rotation)
void
setX(double x)
void
setY(double y)
void
setZ(double z)
void
spawn()
Spawns this entity into the world (For NPCs dont forget to set their home position)void
storeAsClone(int tab, java.lang.String name)
Stores the entity as clone server sideboolean
typeOf(int type)
-
Method Details
-
getX
double getX() -
setX
void setX(double x) -
getY
double getY() -
setY
void setY(double y) -
getZ
double getZ() -
setZ
void setZ(double z) -
getBlockX
int getBlockX() -
getBlockY
int getBlockY() -
getBlockZ
int getBlockZ() -
getPos
IPos getPos() -
setPos
-
setPosition
void setPosition(double x, double y, double z) -
setRotation
void setRotation(float rotation)- Parameters:
rotation
- The rotation to be set (0-360)
-
getRotation
float getRotation()- Returns:
- Current rotation of the entity
-
getHeight
float getHeight()- Returns:
- Returns the height of the bounding box
-
getEyeHeight
float getEyeHeight()- Returns:
- Returns the eye height of the entity, used in this like canSee and such
-
getWidth
float getWidth()- Returns:
- Returns the width of the bounding box
-
setPitch
void setPitch(float pitch)- Parameters:
pitch
- The viewing pitch
-
getPitch
float getPitch()- Returns:
- Entities viewing pitch
-
getMount
IEntity getMount() -
setMount
-
getRiders
IEntity[] getRiders()- Returns:
- Returns the entities riding this entity
-
getAllRiders
IEntity[] getAllRiders()- Returns:
- Returns the entities riding this entity including the entities riding those entities
-
addRider
-
clearRiders
void clearRiders() -
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()
-
isSneaking
boolean isSneaking() -
isSprinting
boolean isSprinting() -
dropItem
-
inWater
boolean inWater() -
inFire
boolean inFire() -
inLava
boolean inLava() -
getTempdata
IData getTempdata()Temp data stores anything but only untill it's reloaded -
getStoreddata
IData getStoreddata()Stored data persists through world restart. Unlike tempdata only Strings and Numbers can be saved -
getNbt
INbt getNbt()The Entity's extra stored NBT data- Returns:
- The Entity's extra stored NBT data
-
isAlive
boolean isAlive() -
getAge
long getAge()- Returns:
- The age of this entity in ticks
-
despawn
void despawn()Despawns this entity. Removes it permanently -
spawn
void spawn()Spawns this entity into the world (For NPCs dont forget to set their home position) -
kill
void kill()Kill the entity, doesnt't despawn it -
isBurning
boolean isBurning()- Returns:
- Return whether or not this entity is on fire
-
setBurning
void setBurning(int seconds)- Parameters:
seconds
- Amount of seconds this entity will burn.
-
extinguish
void extinguish()Removes fire from this entity -
getWorld
IWorld getWorld()- Returns:
- Returns the
IWorld
-
getTypeName
java.lang.String getTypeName()- Returns:
- Name as which it's registered in minecraft
-
getType
int getType()- Returns:
- Returns the
EntityType
of this entity
-
typeOf
boolean typeOf(int type)- Parameters:
type
-EntityType
to check- Returns:
- Returns whether the entity is type of the given
EntityType
-
getMCEntity
T getMCEntity()Expert users only- Returns:
- Returns minecrafts entity
-
getUUID
java.lang.String getUUID() -
generateNewUUID
java.lang.String generateNewUUID() -
storeAsClone
void storeAsClone(int tab, java.lang.String name)Stores the entity as clone server side- Parameters:
tab
-name
-
-
getEntityNbt
INbt getEntityNbt()This is not a function you should be calling every tick. Returns the entire entity as nbt -
setEntityNbt
This is not a function you should be calling every tick -
rayTraceBlock
IRayTrace rayTraceBlock(double distance, boolean stopOnLiquid, boolean ignoreBlockWithoutBoundingBox)Gets the first block within distance the npc is looking at- Parameters:
distance
-stopOnLiquid
-ignoreBlockWithoutBoundingBox
-- Returns:
-
rayTraceEntities
IEntity[] rayTraceEntities(double distance, boolean stopOnLiquid, boolean ignoreBlockWithoutBoundingBox)Gets the entities within distance the npc is looking at sorted by distance- Parameters:
distance
-stopOnLiquid
-ignoreBlockWithoutBoundingBox
-- Returns:
-
getTags
java.lang.String[] getTags()Tags are used by scoreboards and can be used in commands -
addTag
void addTag(java.lang.String tag) -
hasTag
boolean hasTag(java.lang.String tag) -
removeTag
void removeTag(java.lang.String tag) -
playAnimation
void playAnimation(int type)Play specific minecraft animations client side 0 and 3 are for EntityLivingBase entities and 2 is only for players- Parameters:
type
- 0:Swing main hand, 1:Hurt animation, 2:Wakeup Player 3:Swing offhand hand, 4:Crit particle, 5:Spell crit particle
-
damage
void damage(float amount) -
getMotionX
double getMotionX() -
getMotionY
double getMotionY() -
getMotionZ
double getMotionZ() -
setMotionX
void setMotionX(double motion) -
setMotionY
void setMotionY(double motion) -
setMotionZ
void setMotionZ(double motion) -
getName
java.lang.String getName()- Returns:
- Returns the current name displayed by the entity
-
setName
void setName(java.lang.String name)- Parameters:
name
- Set a custom name for this entity
-
hasCustomName
boolean hasCustomName() -
getEntityName
java.lang.String getEntityName()- Returns:
- Returns the original name incase a custom name has been set
-