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.
I can see several issues with your setup.
- First of all, there is no need for
testfor
here. The beauty of target selectors is that they work the same in all commands, including tp
.
- Secondly, there must not be a space between
@a
and the []
(the target selector arguments)
- You can specify a radius with your target coordinates in order to make the detection more reliable. I am not sure which value the game assumes by default, but manually setting it to 1 can't hurt.
All things considered, the command you are looking for is simply
tp @a[x=1,y=34,z=70,r=1] 273 33 -5
or using 4 argument shorthand:
tp @a[1,34,70,1] 273 33 -5
Best Answer
This is exactly the type of situation that
/execute align
was made for: