1

Have a problem with using the "execute" command

Denisowator •3/17/16 5:43 pm
•
460
•
3/18/2016 1:31 pm
So I'm working on a long parkour map, which will have blocks as checkpoints. I thought of this after watching a youtuber play a parkour map, consisting of 5 different planets with custom gravity, and all that. And it had a mechanic, that when you stood on a gold block, it sets your spawnpoint on it. (can't remember the map's name)

I found this video https://www.youtube.com/watch?v=wtir1hyCwdQ, but when I try to change the stained clay part to emerald_block, it says "/spawnpoint is not a valid number" which is the next thing after checking that the player is standing on that block. And when I add 1 or 0, or any number after the block name, it says "cannot execute 'detect' as Denisowator". I've seen many people have this exact error message pop up on their command blocks, or in chat, but in none of the forums, or websites, did I find the solution.

Someone please help.
Posted by
Denisowator
Level 25 : Expert Warrior
12

  Have something to say?

Join • Sign in

8

DepthStrider
• 03/18/2016 1:31 pm
• Level 19 : Journeyman Artist
That makes no sense. But you should change that command a bit

/execute @a ~ ~ ~ detect ~ ~-1 emerald_block 0 /spawnpoint @a[c=1] ~ ~1 ~
If you use your command it'll detect if there's an emerald block below. And that player will run the spawnpoint command to ALL players, which I assume should only work for the player that stepped on the block? If not then you can keep it as it is.
1
Denisowator
• 03/17/2016 8:52 pm
• Level 25 : Expert Warrior
It works!

I got rid of the [type=Player] at the beginning, and changed both "@e" and "@p" to "@a".

So now it's /execute @a ~ ~ ~ detect ~ ~-1 ~ minecraft:emerald_block 0 /spawnpoint @a ~ ~1 ~
1
DepthStrider
• 03/17/2016 8:42 pm
• Level 19 : Journeyman Artist
Well all blocks have a value and if they don't they default to 0 so technically it should work.
1
Denisowator
• 03/17/2016 8:45 pm
• Level 25 : Expert Warrior
I'll try merging the two commands. So I'll keep my one, and just change all the targeting to @a.
1
DepthStrider
• 03/17/2016 8:23 pm
• Level 19 : Journeyman Artist
Hm, I'm not sure what it might be. The command error suggests that the block you're standing on top of isn't emerald. And therefore it won't run the spawnpoint command.
1
Denisowator
• 03/17/2016 8:40 pm
• Level 25 : Expert Warrior
My thinking is that the number that it wants is the second ID after the ":". Since you still have to type the numerical ID for the type of block when putting them into commands, such as wool or stained blocks. So it would be "wool 2" for magenta, and since an emerald block doesn't have any other types, there can't be a number after it. But then it returns to the problem, where it thinks that "/spawnpoint" is the type ID of the block. These command blocks man. Can't live with them, can't make proper maps without them. :/
1
Denisowator
• 03/17/2016 8:11 pm
• Level 25 : Expert Warrior
This is the one I'm using, and yes, it's similar.

/execute @e[type=Player] ~ ~ ~ detect ~ ~-1 ~ minecraft:emerald_block 0 /spawnpoint @p ~ ~1 ~

The video is for 1.8.7, and I'm on 1.8.9. So I have no clue whether they changed some command stuff in between the updates.
1
DepthStrider
• 03/17/2016 7:44 pm
• Level 19 : Journeyman Artist
Type the exact command you're using here. And you're doing something similar to this?

/execute @a ~ ~ ~ detect ~ ~-1 ~ emerald_block 0 /spawnpoint @a[c=1]
1

Welcome