#How would I make this command not attack the person using it?
1 messages · Page 1 of 1 (latest)
<@&1201956957406109788>
💬 While you wait, take this time to provide more context and details.
🙇 If nobody has answered you by <t:1723595690:t>, feel free to use the Summon Helpers button to ping our helper team.
✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve
execute if score @s matches 9 run damage @n 1 magic at ^10 ^ ^
you need to change the @n selector to not just target the nearest entity (which is the player who's running it.) you could check for an entity outside of a small radius, or you could give the attacking player a tag so that they don't get damaged by the command.
for the first example, you could use @n[distance=1..], and in the second example, you could use something like @n[tag=!attacking]
also, this isn't the right syntax for an execute if score command.
execute if score is good if you're comparing one player's score to another. it would probably be more appropriate to do a score check in the entity selector for this case.
You can do execute if score for something like this, the command is just missing the actual scoreboard objective to be checked
you can also give the player a tag before the damage command, then damage all entities without that tag and then remove the tag
... i may have said that lol
oh lol then I may've misunderstood :P
If your question is resolved, that's great to hear! Make sure to run /resolve or click the Resolve Question button. Otherwise, feel free to continue asking for help! :D