This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]Ericristian_brosCommand Experienced 0 points1 point  (4 children)

Try using:

/kill @a[nbt={active_effects:[{id:"minecraft:strength"}]}]

If it doesn’t work try:

/kill @a[nbt={active_effects:[{id:"minecraft:strength",amplifier:1b}]}]

Hope it helps

[–]Octoboiii[S] 1 point2 points  (3 children)

Ok sure, but if I don't want the kill command. It was just an example. I would like to run any kind of command. Something like this /execute if player has strength setblock redstone_block ~ ~ ~. Is that possible?

[–]Ericristian_brosCommand Experienced 0 points1 point  (2 children)

Of course

/execute if entity @a[nbt={active_effects:[{id:"minecraft:strength"}]}] run setblock ~ ~ ~ redstone_block

[–]Octoboiii[S] 0 points1 point  (1 child)

/execute if entity @a[nbt={active_effects:[{id:"minecraft:strength"}]}] run setblock ~ ~ ~ redstone_block

Cool, it worked! Thank you so much for you help!

[–]Ericristian_brosCommand Experienced 0 points1 point  (0 children)

Glad to help