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.
You can spawn a redstone block a certain numbers above or below the point of the player with an activator rail ontop. Then spawn a command minecart on the activator rail with the command /spreadplayers ~ ~ 1 false @e[name=PlayerHome,type=ArmorStand,c=1,r=2]
.
Because the /spreadplayers
will load the chunk the entity is spread to, the commandblock minecart on the activator rail will permenantly keep the chunk that the armorstand is in loaded. When moving the point, run a fill command and a kill command at the previous home to remove the traces. When you are teleporting the player back to their home, you can simply offset the teleportation by a few blocks in the y coordinate.
Best Answer
First of all, I suggest reading this post's answer because it will likely have a lot of information which is helpful to you.
Secondly, in it's simplest form the
/tp
command takes two entity arguments, or one entity and one location argument./tp <entity> <entity>
or/tp <entity> [<Pos>]
.If you wanted to teleport the nearest sheep to the nearest villager, relative to your location, you would do
/tp @e[type=sheep,sort=nearest,limit=1] @e[type=villager,sort=nearest,limit=1]
.All entities selected by the first argument will be teleported to the entity selected by the second argument. Keep in mind that the second selector must only select one entity, or otherwise you will get an error.
For more information, see the links provided in Robbie's answer.