74 $subjectName = array_shift($args);
80 $subject = $this->fetchPermittedPlayerTarget($sender, $subjectName, DefaultPermissionNames::COMMAND_TELEPORT_SELF, DefaultPermissionNames::COMMAND_TELEPORT_OTHER);
81 if($subject ===
null){
87 $targetPlayer = $this->findPlayer($sender, $args[0]);
88 if($targetPlayer ===
null){
92 $subject->teleport($targetPlayer->getLocation());
93 Command::broadcastCommandMessage($sender, KnownTranslationFactory::commands_tp_success($subject->getName(), $targetPlayer->getName()));
98 $base = $subject->getLocation();
99 if(count($args) === 5){
100 $yaw = (float) $args[3];
101 $pitch = (float) $args[4];
104 $pitch = $base->pitch;
107 $x = $this->getRelativeDouble($base->x, $sender, $args[0]);
108 $y = $this->getRelativeDouble($base->y, $sender, $args[1], World::Y_MIN, World::Y_MAX);
109 $z = $this->getRelativeDouble($base->z, $sender, $args[2]);
110 $targetLocation =
new Location($x, $y, $z, $base->getWorld(), $yaw, $pitch);
112 $subject->teleport($targetLocation);
113 Command::broadcastCommandMessage($sender, KnownTranslationFactory::commands_tp_success_coordinates(
115 (
string) round($targetLocation->x, 2),
116 (
string) round($targetLocation->y, 2),
117 (
string) round($targetLocation->z, 2)