In Minecraft java edition, @s stands for "current entity" and works only if you type in chat.
Is there any other way to use the current entity on command block? @s doesn't work there.
1 Answer
@s stands for self (I suppose) and can be set trough as <target> inside execute commands.
You are able to do as such:
execute as @a run say I am @sThe command say I am @s will run once for each target in execute as @a (In this case, every player) and @s will change for each player on each iteration. For example, let us say there are 3 players ingame, Ast, Bor and Cro. execute as @a will act as if each player had typed in their own chat say I am @s resulting in each player type their own name in chat:
[Ast] I am Ast
[Bor] I am Bor
[Cro] I am CroSimilary, If you use relative positions (~ ~ ~ or ^ ^ ^), these can be set trough at <target>. You can do for example execute as @a at @s which will iterate each player, making @s and relative position use those of the player.