teleport To Player

Teleport entities to a player.

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

Parameters

  • target: a target selector that chooses which entities will be teleported
  • destination: a target selector that determines which player the entities will be teleported to

Example

Teleport all zombies to the current player. Run!

mobs.teleportToPlayer(
    mobs.entitiesByType(mobs.monster(MonsterMob.Zombie)),
    mobs.target(LOCAL_PLAYER)
);

See also

||mobs:teleport to position||