Files

1.9 KiB

IScriptEntity.unlockRotation

← IScriptEntity · ← Master

Parça 4/17 · önceki · sonraki

subject.setBurning(0); }

setBurning

void setBurning(int seconds)

Set entity on fire for given amount of ticks. If 0 will be provided as the sole argument, then entity's fire will be extinguished.

var subject = c.getSubject(); var ray = subject.rayTrace(32);

if (ray.isEntity()) { ray.getEntity().setBurning(2); }

isSneaking

boolean isSneaking()

Is this entity is sneaking.

var subject = c.getSubject();

if (subject.isSneaking()) { subject.send("You completed Simon's task!"); }

isSprinting

boolean isSprinting()

Is this entity is sprinting.

var subject = c.getSubject();

if (subject.isSprinting()) { subject.send("This way, you'll run away way faster from zombies!"); }

isOnGround

boolean isOnGround()

Is this entity on the ground.

rayTrace

IScriptRayTrace rayTrace(double maxDistance)

Ray trace from entity's looking direction (including any entity intersection). Check IScriptRayTrace for an example.

rayTraceBlock

IScriptRayTrace rayTraceBlock(double maxDistance)

Ray trace from entity's looking direction (excluding entities). Check IScriptRayTrace for an example.

getMainItem

IScriptItemStack getMainItem()

Get item held in main hand.

var subject = c.getSubject(); var item = subject.getMainItem();

// Lightning bolt admin stick idk I didn't play on servers if (item.getItem().getId() === "minecraft:stick") { c.executeCommand("/summon lightning_bolt ~ ~ ~"); }

setMainItem

void setMainItem(IScriptItemStack stack)

Set item held in main hand.

// We did a little bit of trolling c.getSubject().setMainItem(mappet.createItem("minecraft:diamond_hoe"));

getOffItem

IScriptItemStack getOffItem()