BlockPos
Represents a position of a block in the world
This class was added by a mod with mod-id crafttweaker
. So you need to have this mod installed if you want to use this feature.
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.
Constructors
Parameter | Type | Description |
---|---|---|
Parameter x | Type int | Description No description provided |
Parameter y | Type int | Description No description provided |
Parameter z | Type int | Description No description provided |
Methods
add
Adds two positions together and returns the result.
Returns crafttweaker.api.util.BlockPos
Parameter | Type | Description |
---|---|---|
Parameter pos | Type crafttweaker.api.util.BlockPos | Description other position to add |
Adds the given values to this position, and returns a new position with the new values.
Returns crafttweaker.api.util.BlockPos
Parameter | Type | Description |
---|---|---|
Parameter x | Type double | Description x value to add |
Parameter y | Type double | Description y value to add |
Parameter z | Type double | Description z value to add |
crossProduct
Creates a new BlockPos based on the cross product of this position, and the given position
Returns crafttweaker.api.util.BlockPos
Parameter | Type | Description |
---|---|---|
Parameter pos | Type crafttweaker.api.util.BlockPos | Description BlockPos to cross product |
distanceSq
Gets the squared distance of this position to the specified BlockPos, using the center of the BlockPos
Returns double
Parameter | Type | Description |
---|---|---|
Parameter to | Type crafttweaker.api.util.BlockPos | Description BlockPos to check against |
Gets the squared distance of this position to the specified BlockPos
Returns double
Parameter | Type | Description |
---|---|---|
Parameter to | Type crafttweaker.api.util.BlockPos | Description BlockPos to check against |
Parameter useCenter | Type boolean | Description should the center of the coordinate be used? (adds 0.5 to each value) |
Gets the squared distance of this position to the specified coordinates
Returns double
Parameter | Type | Description |
---|---|---|
Parameter x | Type double | Description x position to check against |
Parameter y | Type double | Description y position to check against |
Parameter z | Type double | Description z position to check against |
Parameter useCenter | Type boolean | Description should the center of the coordinate be used? (adds 0.5 to each value) |
down
Creates a new BlockPos based on this BlockPos that is one block lower than this BlockPos
Returns: a new BlockPos that is one block lower than this BlockPos
Returns net.minecraft.util.math.BlockPos
east
Creates a new BlockPos based on this BlockPos that is one block east of this BlockPos
Returns: a new BlockPos that is one block east of this BlockPos
Returns net.minecraft.util.math.BlockPos
Creates a new BlockPos based on this BlockPos that is n block(s) east of this BlockPos
Returns: a new BlockPos that is n block(s) east of this BlockPos
Returns net.minecraft.util.math.BlockPos
Parameter | Type | Description |
---|---|---|
Parameter n | Type int | Description No description provided |
manhattanDistance
Gets the Manhattan Distance of this pos compared to a different position
Returns int
Parameter | Type | Description |
---|---|---|
Parameter other | Type crafttweaker.api.util.BlockPos | Description other position to get the distance to |
north
Creates a new BlockPos based on this BlockPos that is one block north of this BlockPos
Returns: a new BlockPos that is one block north of this BlockPos
Returns net.minecraft.util.math.BlockPos
Creates a new BlockPos based on this BlockPos that is n block(s) north of this BlockPos
Returns: a new BlockPos that is n block(s) north of this BlockPos
Returns net.minecraft.util.math.BlockPos
Parameter | Type | Description |
---|---|---|
Parameter n | Type int | Description No description provided |
offset
Creates a new BlockPos based on this BlockPos that is one block offset of this BlockPos based on the given crafttweaker.api.util.Direction
Returns: a new BlockPos that is 1 block offset of this BlockPos
Returns crafttweaker.api.util.BlockPos
Parameter | Type | Description |
---|---|---|
Parameter direction | Type crafttweaker.api.util.Direction | Description No description provided |
Creates a new BlockPos based on this BlockPos that is n block(s) offset of this BlockPos based on the given crafttweaker.api.util.Direction
Returns: a new BlockPos that is n block(s) offset of this BlockPos
Returns crafttweaker.api.util.BlockPos
Parameter | Type | Description |
---|---|---|
Parameter direction | Type crafttweaker.api.util.Direction | Description No description provided |
Parameter n | Type int | Description No description provided |
south
Creates a new BlockPos based on this BlockPos that is one block south of this BlockPos
Returns: a new BlockPos that is one block south of this BlockPos
Returns net.minecraft.util.math.BlockPos
Creates a new BlockPos based on this BlockPos that is n block(s) south of this BlockPos
Returns: a new BlockPos that is n block(s) south of this BlockPos
Returns net.minecraft.util.math.BlockPos
Parameter | Type | Description |
---|---|---|
Parameter n | Type int | Description No description provided |
subtract
Subtracts two positions together and returns the result.
Returns crafttweaker.api.util.BlockPos
Parameter | Type | Description |
---|---|---|
Parameter pos | Type crafttweaker.api.util.BlockPos | Description other position to remove |
up
Creates a new BlockPos based on this BlockPos that is one block higher than this BlockPos
Returns: a new BlockPos that is one block higher than this BlockPos
Returns net.minecraft.util.math.BlockPos
Creates a new BlockPos based on this BlockPos that is n block(s) higher than this BlockPos
Returns: a new BlockPos that is n block(s) higher than this BlockPos
Returns net.minecraft.util.math.BlockPos
Parameter | Type | Description |
---|---|---|
Parameter n | Type int | Description No description provided |
west
Creates a new BlockPos based on this BlockPos that is one block west of this BlockPos
Returns: a new BlockPos that is one block west of this BlockPos
Returns net.minecraft.util.math.BlockPos
Creates a new BlockPos based on this BlockPos that is n block(s) west of this BlockPos
Returns: a new BlockPos that is n block(s) west of this BlockPos
Returns net.minecraft.util.math.BlockPos
Parameter | Type | Description |
---|---|---|
Parameter n | Type int | Description No description provided |
withinDistance
Checks if the given BlockPos is within the specified distance of this BlockPos (this uses the middle of the BlockPos)
Returns boolean
Parameter | Type | Description |
---|---|---|
Parameter pos | Type crafttweaker.api.util.BlockPos | Description BlockPos to check if it is within the distance |
Parameter distance | Type double | Description distance to check within |
Properties
Name | Type | Has Getter | Has Setter |
---|---|---|---|
Name x | Type int | Has Getter true | Has Setter false |
Name y | Type int | Has Getter true | Has Setter false |
Name z | Type int | Has Getter true | Has Setter false |
Operators
ADD
Adds two positions together and returns the result.
Parameter | Type | Description |
---|---|---|
Parameter pos | Type crafttweaker.api.util.BlockPos | Description other position to add |
SUB
Subtracts two positions together and returns the result.
Parameter | Type | Description |
---|---|---|
Parameter pos | Type crafttweaker.api.util.BlockPos | Description other position to remove |
Casters
Result type | Is Implicit |
---|---|
Result type long | Is Implicit false |