I'm trying to make when I shoot an enemy with a tipped_arrow with the effect Fire Resistance, this active a particle in them.

I make this command that actually work but not how I would like...

/testfor @e[type=Spider] {ActiveEffects:[{Id:12b}]}

and next with a comparator, I use this command for active the particles...

/execute @e[type=Spider] ~ ~ ~  /particle flame ~ ~1 ~ 1.5 1 1.5 0 3 normal @e

The problem is that this active the particle in all spiders and not in the specific spider.


The best way to do this would be to use a scoreboard tag. The scoreboard command, like testfor, can search for entities with partial nbt matches, but can also mark them for other commands.

/scoreboard players tag @e[type=spider] add SpiderMark {ActiveEffects:[{Id:12b}]}

If you use this all spider's with fire resistance will receive the "SpiderMark" tag. Then you can add the tag=SpiderMark to the entity selector in the particle command to only play the particle command off spider's with fire resistance.

/execute @e[type=spider,tag=SpiderMark] ~ ~ ~ particle flame ~ ~1 ~ 1.5 1 1.5 0 3 normal @a

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.