Files

1.9 KiB

IScriptEntity.unlockRotation

← IScriptEntity · ← Master

Parça 10/17 · önceki · sonraki

var s = c.getSubject(); var ray = s.rayTrace(64);

if (ray.isEntity()) { s.mount(ray.getEntity()); } }

dismount

void dismount()

Dismount this entity from the entity it's riding.

function main(c) { c.getSubject().dismount() }

getMount

IScriptEntity getMount()

Returns the entity that this entity rides on.

var s = c.getSubject();

s.getMount();

getBoundingBox

ScriptBox getBoundingBox()

Returns the bounding box of this entity.

var s = c.getSubject(); var box = s.getBoundingBox(); c.send("The bounding box of " + s.getName() + " is " + box.minX + ", " + box.minY + ", " + box.minZ + " to " + box.maxX + ", " + box.maxY + ", " + box.maxZ);

Returns: the bounding box of this entity

dropItem

ScriptEntityItem dropItem(int amount)

Drop the item an entity is holding.

var s = c.getSubject(); var entityItem = s.dropItem(10); entityItem.setNoDespawn(); entityItem.setInfinitePickupDelay();

dropItem

ScriptEntityItem dropItem()

Drop one item of what the entity is holding.

var s = c.getSubject(); var entityItem = s.dropItem(); entityItem.setNoDespawn(); entityItem.setInfinitePickupDelay();

dropItem

ScriptEntityItem dropItem(IScriptItemStack itemStack)

Drop an item of the entity even if it is not holding it. Therefore, it doesn't remove the item from the entity's inventory.

var item = mappet.createItemNBT("{id:"minecraft:stone",Count:64b,Damage:0s}"); var entityItem = c.getSubject().dropItem(item); entityItem.setNoDespawn(); entityItem.setInfinitePickupDelay();

getFallDistance

float getFallDistance()

Get entity's fall distance.

setFallDistance

void setFallDistance(float distance)

Set entity's fall distance.