If you only want to teleport people who are in a certain group, you can use the new scoreboard command to create a 'group' of people (using teams), and then teleport only that team with this command (targets nearest player in the group specified)
/tp @p[team=<internal group name>,<other params here>] <x> <y> <z>
To set up your groups, you can create a group like this:
/scoreboard teams add <internal group name> <display name>
And then add people to this group like this:
/scoreboard teams join <internal group name> <user name>
The advantage of this system is also that you can use it actually to separate groups in the actual game. The scoreboard command has a feature that means that the display name
of a team will be displayed before the actual username, appearing like this in the chat:
[<display name>] <user name>: ...
More info on this system can be found in the wiki page linked above.
Changing the @p
in the first command above to a player name will stop it from working, because parameters that are inside the [
and ]
will only work for @p
, @a
, and @r
. So you cannot substitute the first command above to /tp <player name>[r=2] <x> <y> <z>
. It just won't work.
If you really want to use the r
parameter on a single person, try using the above method that uses teams, but only put one person in the team. Here is a quick way to do this. Type these into the command console:
/scoreboard teams add <internal player name> <external player name>
/scoreboard teams join <internal player name> <player name>
And then in the command block, to teleport that person if they are in a radius of 2, you could use:
/tp @p[team=<internal player name>,r=2] <x> <y> <z>
Alternatively, you could just specify the name of the player in the selector. Following the previous example, if you want to teleport a certain person if they are in a radius of 2, you could use:
/tp @p[name=<player name>,r=2] <x> <y> <z>
this is considered a simple command in Minecraft, but I think I can help you. To teleport a player, have them either step on a pressure plate, press a button, or switch a lever that is next to a command block with the command /tp @p x y z
When I say x y z
I mean the coordinates that you want to teleport the player to. To get those coordinates, go to the location you want the player(s) to teleport to, and press the keys: fn+f3
(function key and the f3 key.) On one of the rows of text in the upper left-center, there will be something like x=46.33263 y=3643.532366 z=125.23146
. You do not need the decimals to teleport the player, so just remember the numbers 46,3643,125
or whatever your set of numbers may be. Simply replace the x y z
that you put into the command block with these numbers, and Ta Da! (Also, if one or more of these numbers are negative, then the number put into the command block ALSO has to be a negative number.) Just in case you didn't know, to get a command block, you do /give @p minecraft:command_block
Hope this Helps!
-A
Best Answer
Both the
/op <player>
command and editingops.txt
file method still work in both 1.4.7 and 1.5. If the file does not exist, make a new file named that, and put your user name in it.Please note that the
op <player>
command should be typed on the server, NOT IN THE GAME. If you try to type that in the actual game, you will get an error saying you do not have permission to use this command (because you are not yet an OP).