target

Chooses a group of players or mobs.

mobs.target(LOCAL_PLAYER);

Parameters

  • kind: the type of mobs to select:
    • local player: select the current player (you)
    • nearest player: select the player nearest to the world origin
    • random player: select a random player in the world
    • all players: select all players in the world
    • all entities: select all players and mobs
    • my agent: select the agent

Example

Teleport all players, animals and monsters to the current player.

mobs.teleportToPlayer(
    mobs.target(ALL_ENTITIES),
    mobs.target(LOCAL_PLAYER)
);

See Also

Using target selectors is described in the Minecraft wiki.