equals
Compare two positions to see if they are equal.
positions.equals(pos(0, 0, 0), pos(0, 0, 0))You can compare any two positions to see if they are the same (equivalent) in the world. Any relative or local positions are compared based on their actual world positions.
Parameters
- p1: the first position to compare with position in p2.
- p2: the second position to compare with position in p1.
Returns
- a boolean value that is
trueif the two positions are the same orfalseif they are not the same.
Example
Teleport the agent to the player if it's not there already.
if (!positions.equals(player.position(), agent.getPosition()))
{
agent.teleportToPlayer()
}