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>
The best way I know Is to use /summon Fireball. The player hits the fire charge and if goes flying. As something to it for costom things:
/summon Fireball ~ ~ ~ {ExplosionPower:0,direction:[0.0,0.0,0.0]}
Don't worry about direction; the player can hit it werever, adding a challenge of aiming correctly.change the integer for ExplosionPower to what ever the highst # you need is. To find out, google minecraft [block name] And click on the minecraft forums link. Under the image of the block you will see "Blast resistance" if the resistance is four set the ExplosionPower to something like 5.
To summon at the player, do (in the snapshot and hopefully the next update)
/execute @p ~ ~ ~
/summon Fireball ~ ~ ~ {ExplosionPower:0,direction:[0.0,0.0,0.0]}
ALL ONE COMMAND
Links to refer to: planetminecraft and Minecraft Wiki
Hope this helps and if you don't understand go to the above links, they got me a jump start into commands.
Sorry no TNT but if you find a way you can still use ExplosionPower on the primed TNT tag. Also you can modify how long the TNT exists, ex Time=99999 instead of direction, or it will explode opon summoning.
Best Answer
The following will teleport a player one block into the air:
Here is the breakdown:
/tp
- The command to teleport a player@p
- The player closest to you. Also, if you are playing with Command Blocks, then this will teleport the player standing closest to the command block.The next three are the X, Y, and Z coordinates. The tilde means "relative to the current position".
~0
- Zero blocks in the X (East/West) direction~1
- Positive one blocks in the Y (Up/Down) direction~0
- Zero blocks in the Z (North/South) directionA tilde by itself is shorthand for
~0
. For example, the following will teleport the player down (in the negative Y direction) five blocks.