BlockPos
Importing the class
It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.
import crafttweaker.api.util.math.BlockPos;
Extending Vec3i
BlockPos extends Vec3i. That means all methods available in Vec3i are also available in BlockPos
Constructors
Creates a new BlockPos using the values of the given vector. Note, the values will be floored down, providing 0.85 is the same as providing 0.
new BlockPos(vector as Vec3) as BlockPosnew BlockPos(new Vec3(0, 1, 2));
Parameter | Type | Description |
---|---|---|
Parameter vector | Type Vec3 | Description The vector to copy the values of. |
Creates a new BlockPos using the provided values.
new BlockPos(x as int, y as int, z as int) as BlockPosnew BlockPos(0, 1, 2);
Parameter | Type | Description |
---|---|---|
Parameter x | Type int | Description The x value of the blockpos |
Parameter y | Type int | Description The y value of the blockpos |
Parameter z | Type int | Description The z value of the blockpos |
Methods
Return Type: BlockPos
// BlockPos.above() as BlockPos
myBlockPos.above();
Return Type: BlockPos
BlockPos.above(distance as int) as BlockPos
Parameter | Type |
---|---|
Parameter distance | Type int |
Return Type: BlockPos
// BlockPos.asImmutable() as BlockPos
myBlockPos.asImmutable();
Return Type: long
// BlockPos.asLong() as long
myBlockPos.asLong();
Return Type: MutableBlockPos
// BlockPos.asMutable() as MutableBlockPos
myBlockPos.asMutable();
Return Type: BlockPos
BlockPos.atY(value as int) as BlockPos
Parameter | Type |
---|---|
Parameter value | Type int |
Return Type: BlockPos
// BlockPos.below() as BlockPos
myBlockPos.below();
Return Type: BlockPos
BlockPos.below(distance as int) as BlockPos
Parameter | Type |
---|---|
Parameter distance | Type int |
Return Type: BlockPos
// BlockPos.east() as BlockPos
myBlockPos.east();
Return Type: BlockPos
BlockPos.east(distance as int) as BlockPos
Parameter | Type |
---|---|
Parameter distance | Type int |
Return Type: BlockPos
BlockPos.multiply(scalar as int) as BlockPos
Parameter | Type |
---|---|
Parameter scalar | Type int |
Return Type: BlockPos
// BlockPos.north() as BlockPos
myBlockPos.north();
Return Type: BlockPos
BlockPos.north(distance as int) as BlockPos
Parameter | Type |
---|---|
Parameter distance | Type int |
Return Type: BlockPos
BlockPos.offset(x as double, y as double, z as double) as BlockPos
Parameter | Type |
---|---|
Parameter x | Type double |
Parameter y | Type double |
Parameter z | Type double |
Return Type: BlockPos
BlockPos.offset(x as int, y as int, z as int) as BlockPos
Parameter | Type |
---|---|
Parameter x | Type int |
Parameter y | Type int |
Parameter z | Type int |
Return Type: BlockPos
// BlockPos.south() as BlockPos
myBlockPos.south();
Return Type: BlockPos
BlockPos.south(distance as int) as BlockPos
Parameter | Type |
---|---|
Parameter distance | Type int |
Return Type: BlockPos
// BlockPos.west() as BlockPos
myBlockPos.west();
Return Type: BlockPos
BlockPos.west(distance as int) as BlockPos
Parameter | Type |
---|---|
Parameter distance | Type int |