1

/testfor command help

TSchweibz's Avatar TSchweibz1/31/15 6:04 pm
1 emeralds 401 5
2/2/2015 8:57 am
Davekillerish's Avatar Davekillerish
I have made parkour in my adventure map across a city but have no way to kill the player when they mess up and hit the ground. I was thinking about using the /testfor command block lined up to one that kills the player and sets their spawn to the latest checkpoint. The problem is that if I use the radius tag for 12 the radius becomes a 12x12 square, what I want is to have them get detected at a certain y-value(12) anywhere on the world. So it would create a sheet of area where the command block would test positive for the player being at that y-value. I tried using more than one command block, but they show up in the world and look bad(it's a superflat world). Any Ideas?
Posted by TSchweibz's Avatar
TSchweibz
Level 2 : Apprentice Miner
0

Create an account or sign in to comment.

5

1
02/02/2015 8:57 am
Level 23 : Expert Nerd
Davekillerish
Davekillerish's Avatar
You can also just make the entire city floor turn to lava when you start it with /fill if your lazy.
1
02/01/2015 8:42 am
Level 2 : Apprentice Miner
TSchweibz
TSchweibz's Avatar
Thank you so much! That is a lot easier!
1
01/31/2015 8:23 pm
Level 33 : Artisan Engineer
Jmal116
Jmal116's Avatar
There's actually another way to do this, if you don't want to put barriers all over your map. With a nested execute, you can run a command on any player who is in on a certain y value like so:execute @a ~ ~ ~ execute @p[y=12,r=0] ~ ~ ~ kill @pThis will kill any player on y=12, thus eliminating the need for barriers.

Noelscrap .... and "0" with the ID (normally IDs are 0) ....

If you want to test for ALL damage values, instead of just assuming they are 0, you can put a -1 in the command instead of a 0. This way things that can rotate like buttons or torches, as well as things can change color like wool, will all get tested.
1
01/31/2015 6:39 pm
Level 2 : Apprentice Miner
TSchweibz
TSchweibz's Avatar
Thank you so much!
1
01/31/2015 6:32 pm
Level 3 : Apprentice Architect
Neolscrap
Neolscrap's Avatar
/execute @a[m=2] ~ ~ ~ detect ~ ~-1 ~ minecraft:block 0 /spawnpoint @p

This sets a player's spawnpoint. Replace "minecraft:block" with a block name that is ONLY used for a checkpoint (for example, a redstone block) and "0" with the ID (normally IDs are 0). Now, onto the detecting.

/execute @a[m=2] ~ ~ ~ detect ~ ~-1 ~ minecraft:barrier 0 /kill @p

So with that command, anyone on adventure mode standing on barriers gets killed. They will spawn on the last checkpoint if you also use the first command.

Now, use a super fast redstone clock and hook it up with those two command blocks. It should work (but they have to be in adventure mode!). If you think they look bad, hide the commands in a building.

Hope this helped.
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome