I've read an issue about this @s selector that it doesn't work in command blocks and @s is never meant to be for the command blocks. If that so, where can we use the @s selector except the chatbox?
I've read an issue about this @s selector that it doesn't work in command blocks and @s is never meant to be for the command blocks. If that so, where can we use the @s selector except the chatbox?
This site is for Bug reports only. Ask for help in other forums.
But, to answer your question, it can be used in /execute commands, as arguments for the function that runs after.
Example:
/execute as @e[type=skeleton] run replaceitem entity @s weapon.mainhand diamond_sword 1
equips all skeletons with diamond swords.