Files

41 lines
1.0 KiB
Markdown

# ScriptBox.offset
[← ScriptBox](index.md) · [← Master](../../wiki.md)
Parça 2/2 · [önceki](offset.md)
var box = mappet.box(-10, 4, -10, 10, 6, 10);
if (box.contains(subjectPosition)){
c.send("the player in in the box")
}
}
contains
public boolean contains(Vector3d vector)
getBlocksPositions
public java.util.List<ScriptVector> getBlocksPositions(ScriptWorld scriptWorld,
ScriptBlockState state)
Returns a list of positions for blocks in the box that match a given block state in a given world.
function main(c)
{
var world = c.getWorld();
var state = mappet.createBlockState("minecraft:stone");
var box = mappet.box(-10, 4, -10, 10, 6, 10);
var blockPositions = box.getBlocksPositions(world, state);
var blockPositionsString = "[";
blockPositions.forEach(function(position) {
blockPositionsString += position.toArrayString() + ", ";
});
blockPositionsString = blockPositionsString.substring(0, blockPositionsString.length - 2);
blockPositionsString += "]";