public class ScriptEntity
extends java.lang.Object
Constructor and Description |
---|
ScriptEntity(net.minecraft.entity.Entity entity) |
Modifier and Type | Method and Description |
---|---|
void |
clearStoredData()
Remove all stored data
|
void |
clearTempData()
Remove all tempdata
|
void |
despawn()
Despawns this entity.
|
void |
dropItem(ScriptItemStack item) |
void |
extinguish()
Removes fire from this entity
|
long |
getAge() |
int |
getBlockX() |
int |
getBlockY() |
int |
getBlockZ() |
net.minecraft.entity.Entity |
getMCEntity() |
ScriptEntity |
getMount() |
ScriptEntity |
getRider() |
float |
getRotation() |
java.lang.Object |
getStoredData(java.lang.String key) |
ScriptEntity[] |
getSurroundingEntities(int range) |
ScriptEntity[] |
getSurroundingEntities(int range,
int type) |
java.lang.Object |
getTempData(java.lang.String key) |
int |
getType() |
java.lang.String |
getTypeName() |
double |
getX() |
double |
getY() |
double |
getZ() |
boolean |
hasStoredData(java.lang.String key) |
boolean |
hasTempData(java.lang.String key) |
boolean |
inFire() |
boolean |
inLava() |
boolean |
inWater() |
boolean |
isAlive() |
boolean |
isBurning() |
boolean |
isSneaking() |
boolean |
isSprinting() |
void |
knockback(int power,
float direction) |
void |
removeStoredData(java.lang.String key) |
void |
removeTempData(java.lang.String key) |
void |
setBurning(int ticks) |
void |
setMount(ScriptEntity entity) |
void |
setPosition(double x,
double y,
double z) |
void |
setRider(ScriptEntity entity) |
void |
setRotation(float rotation) |
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 restarts
|
void |
setX(double x) |
void |
setY(double y) |
void |
setZ(double z) |
boolean |
typeOf(int type) |
public double getX()
public void setX(double x)
x
- The entities x positionpublic double getY()
public void setY(double y)
y
- The entities y positionpublic double getZ()
public void setZ(double z)
z
- The entities x positionpublic int getBlockX()
public int getBlockY()
public int getBlockZ()
public void setPosition(double x, double y, double z)
x
- The x positiony
- The y positionz
- The z positionpublic ScriptEntity[] getSurroundingEntities(int range)
range
- The search range for entities around this entitypublic ScriptEntity[] getSurroundingEntities(int range, int type)
range
- The search range for entities around this entitytype
- The EntityType you want to findpublic boolean isAlive()
public java.lang.Object getTempData(java.lang.String key)
key
- Get temp data for this keypublic void setTempData(java.lang.String key, java.lang.Object value)
key
- The key for the data storedvalue
- The data storedpublic boolean hasTempData(java.lang.String key)
key
- The key thats going to be tested against the temp datapublic void removeTempData(java.lang.String key)
key
- The key for the temp data to be removedpublic void clearTempData()
public java.lang.Object getStoredData(java.lang.String key)
key
- The key of the data to be returnedpublic void setStoredData(java.lang.String key, java.lang.Object value)
key
- The key for the data storedvalue
- The data stored. This data can be either a Number or a String. Other data is not storedpublic boolean hasStoredData(java.lang.String key)
key
- The key of the data to be checkedpublic void removeStoredData(java.lang.String key)
key
- The key of the data to be removedpublic void clearStoredData()
public long getAge()
public void despawn()
public boolean inWater()
public boolean inLava()
public boolean inFire()
public boolean isBurning()
public void setBurning(int ticks)
ticks
- Amount of world ticks this entity will burn. 20 ticks equals 1 secondpublic void extinguish()
public java.lang.String getTypeName()
public void dropItem(ScriptItemStack item)
item
- Item to be droppedpublic ScriptEntity getRider()
public void setRider(ScriptEntity entity)
entity
- The entity to ride this entitypublic ScriptEntity getMount()
public void setMount(ScriptEntity entity)
entity
- The entity this entity will mountpublic int getType()
EntityType
public boolean typeOf(int type)
type
- @EntityType to checkpublic void setRotation(float rotation)
rotation
- The rotation to be set (0-360)public float getRotation()
public void knockback(int power, float direction)
power
- How strong the knockback isdirection
- The direction in which he flies back (0-360). Usually based on getRotation()public boolean isSneaking()
public boolean isSprinting()
public net.minecraft.entity.Entity getMCEntity()