teleport

Teleports the Agent to another position facing in a certain direction.

agent.teleport(pos(0, 0, 0), WEST)

Parameters

  • pos: the destination position.
  • dir: compass direction, in degrees, that the agent will face.

Examples

Super jump

Teleport the Agent 100 blocks up when the agentjump command is typed in the chat.

player.onChat("agentjump", function () {
    agent.teleport(pos(0,100,0), WEST);
});

Go anywhere

Teleport the agent anywhere in two dimensions from the current location. The Agent goes to a random location 50 blocks North or South, and 50 blocks East or West. The agent moves when the sendagent command is typed in the chat.

player.onChat("sendagent", function () {
    agent.teleport(randpos(
    pos(-50, 0, 50),
    pos(50, 0, -50)), NORTH);
});

See Also

teleport (player), teleport (mob), positions