1.8 KiB
IScriptEntity.unlockRotation
Parça 1/17 · sonraki
unlockRotation()
void Unlock the entity's rotation.
Method Detail getMinecraftEntity
Entity getMinecraftEntity()
Get Minecraft entity instance. BEWARE: you need to know the MCP mappings in order to directly call methods on this instance!
function main(c) { //c.getSubject().getMinecraftEntity().abilities.disableDamage = true c.getSubject().getMinecraftEntity().field_71075_bZ.field_75102_a = true // or false }
getWorld
IScriptWorld getWorld()
Get entity's world.
var s = c.getSubject(); var world = s.getWorld();
world.setRaining(true);
getPosition
ScriptVector getPosition()
Get entity's position.
var pos = c.getSubject().getPosition();
c.send(c.getSubject().getName() + "'s position is (" + pos.x + ", " + pos.y + ", " + pos.z + ")");
setPosition
void setPosition(double x, double y, double z)
Set entity's position (teleport).
c.getSubject().setPosition(800, 8, -135);
getDimension
int getDimension()
Returns the dimension of the entity.
var dimension = c.getSubject().getDimension(); switch (dimension) { case 0: c.send("Overworld"); break; case 1: c.send("The End"); break; case -1: c.send("The Nether"); break; default: c.send("Unknown dimension"); break; }
Returns: The dimension of the entity as an integer.
setDimension
void setDimension(int dimension)
Set the dimension of the entity.
c.getSubject().setDimension(1); // Teleport to The End
Parameters: dimension - The dimension to teleport the entity to.
getMotion
ScriptVector getMotion()
Get entity's motion.
var motion = c.getSubject().getMotion();