forum Forumsplay_arrow Minecraft fiber_manual_record Redstone


Need Help With The /testfor Command

1 emerald4 replies214 views
created 01/04/2016 6:30 am by spacemangames-66
last reply 01/06/2016 6:47 pm
Hi, I'm making a custom map and I'm trying to teleport the player to a location when they die or fall past Y= -4 any will work for me.

I have tried using this in a command block hooked up to a clock
testfor @p [x=~, y=-4, z=~]

Is there a command like this that will work?
Posted by avatar
Level 15 : Journeyman Engineer

comment Login or register to post a reply.

4 replies

01/06/2016 6:47 pm
Level 1 : New Crafter
If die first do /scoreboard objectives add [Name of score you want] stat.timeSinceDeath
then /tp @a[score_[Name of score]_min=1,score_[Name of score]=1] [Cords]
01/04/2016 10:11 am
Level 28 : Expert Engineer
To teleport when a player reaches a certain plane, I would suggest using a nested execute:execute @a ~ ~ ~ tp @p[y=-4,r=0] x y z
In my opinion it's a bit easier to work with than Arcaniax's solution above, though his would likely work just as well.

For people going there when they die, you can simply set the player's spawnpoints throughout the map so they automatically respawn there without any real work put in by you.
01/04/2016 8:03 am
Level 21 : Expert Dragonborn
If I remember correctly this should work in Minecraft 1.9:

tp @a[y=-4,dy=-10] x y z

Unless you fall more than 200 blocks per sec but I don't think so
If that doesn't work you might have to specify x= and y= as well and maybe even dx= and dz=
01/04/2016 7:10 am
Level 83 : Elite Magical Girl
tp @a[x=-10000,y=-100,z=-10000,dx=20000,dy=96,dz=20000] x y z

Planet Minecraft



© 2010 - 2019