I'm trying to detect if a certain block if on an entity. I have done this before but im using a command afterwards that doesn't respond.
/execute as @e[type=armor_stand,nbt={Invulnerable:1b,Invisible:1b}] at @s if block ~ ~ ~ minecraft:stone_button[powered=true] run scoreboard players set @p ingame 5. i tried replacing the at @s but then the ~'s don't work. is there any other awy to detect if a block is on an entity.
I'm trying to detect if a certain block if on an entity. I have done this before but im using a command afterwards that doesn't respond.
/execute as @e[type=armor_stand,nbt={Invulnerable:1b,Invisible:1b}] at @s if block ~ ~ ~ minecraft:stone_button[powered=true] run scoreboard players set @p ingame 5. i tried replacing the at @s but then the ~'s don't work. is there any other awy to detect if a block is on an entity.
First of all, you should name or tag the armor stand because this will execute from EVERY armor stand that is invisible and invulnerable.
Also, keep in mind that ~ ~ ~ points toward the armor stands base and not its head.
Hello, I tried removing the "at @s" but then it didn't detect at all. I also know that it points to the base. I don't know if its a bug or if im stupid.
Hello, I tried removing the "at @s" but then it didn't detect at all. I also know that it points to the base. I don't know if its a bug or if im stupid.
now try using a tag instead of the nbt={...} and tell us how it goes
the command is perfect and should work so I think its either the selector or the button detection is not right
I'm trying to detect if a certain block if on an entity. I have done this before but im using a command afterwards that doesn't respond.
/execute as @e[type=armor_stand,nbt={Invulnerable:1b,Invisible:1b}] at @s if block ~ ~ ~ minecraft:stone_button[powered=true] run scoreboard players set @p ingame 5. i tried replacing the at @s but then the ~'s don't work. is there any other awy to detect if a block is on an entity.
First of all, you should name or tag the armor stand because this will execute from EVERY armor stand that is invisible and invulnerable.
Also, keep in mind that ~ ~ ~ points toward the armor stands base and not its head.
your command is correct and should work.
Command block engineer // Developer // #TeamTrees
why don't you just do this :
/execute at @e[type=armor_stand,nbt={blablabla}] if block ~ ~ ~ stone_button[powered=true] run ...
in your command, the "as" is useless here, just use "at"
Hello, I tried removing the "at @s" but then it didn't detect at all. I also know that it points to the base. I don't know if its a bug or if im stupid.
now try using a tag instead of the nbt={...} and tell us how it goes
the command is perfect and should work so I think its either the selector or the button detection is not right
Command block engineer // Developer // #TeamTrees
I changed the command from @p to @a[limit=1,sort=nearest] and it works. I dont know why the other command didn't work.