mojira.dev
MC-73663

execute inside of execute not working

Put the summary of the bug you're having here

What I expected to happen was...:
a redstone clock with a command block with /execute @p ~ ~ ~ execute @e[r=10,type=!Player] ~ ~ ~ playsound random.pop @p should make it so when i get near to an entity it rapidly plays a pop sound.

What actually happened was...:
it says it failed to run the command as me

Steps to Reproduce:
1. make a redstone clock with a command block
2. enter /execute @p ~ ~ ~ execute @e[r=10,type=!Player] ~ ~ ~ playsound random.pop @p
3. get near an entity or entities, and notice how there is no pop sound.
4. check command block for the error message.

Comments 8

Can't you just do

/execute @e[r=10,type=!Player] ~ ~ ~ playsound random.pop @p

no you can't sonicwave, because he wants the execute effect around the player. what you are doing is that any mob around the COMMAND BLOCK will play the pop sound.

also, i don't have this bug

Why is it @e[r=10,type=!Player]? Why do you need that exclamation mark?

type=!Player

means all entities except Players, as opposed to

type=Player

which means Players only (basically it functions as a "not equal to" sign).

This command works:
execute @e[type=!Player] ~ ~ ~ execute @p[r=10] ~ ~ ~ playsound random.pop @p

The only problem is that it will not work when near another player.
If you want it to do that, then this command will work:
execute @e[name=!"your name here"] ~ ~ ~ execute @p[r=5] ~ ~ ~ playsound random.pop @p

You probably simply just had your sound settings off.
Or could be because you have "/playsound random.pop" and not "/playsound random.pop @p ~ ~ ~ 10 1

Cannot confirm anymore. Probably fixed before 1.9 snapshots.

John John

(Unassigned)

Unconfirmed

Minecraft 1.8

Retrieved