Steps to Reproduce:
1. Create a function tagged in "minecraft:tick".
2. Write in the created function:
execute as @a[tag=bug] run title @a title {"translate":"death.attack.generic","with":[{"selector":"@s"}]}
What I expected to happen was...:
For 1st selector: "(1) died"
For 2nd selector: "(2) died"
What actually happened was...:
For 1st selector: "(1) died"
For 2nd selector: "(1) died"
The video showing this:
https://youtu.be/4OqGOJprpGA
If you don't use the function tagged in "minecraft:tick", it will work fine:
https://youtu.be/YOSgsir7AJw
Linked issues
Comments 7
«The @a selector changes the executing entity»
It should not work like this.
If you don't use the function tagged in "minecraft:tick", it will work fine:
https://youtu.be/YOSgsir7AJw
I ran
/execute as @e[type=armor_stand] run tellraw @a {"translate":"death.attack.generic","with":[{"selector":"@s"}]}
in chat with 2 armor stands in loaded chunks, both with a different name. Both messages used the same entity.
Seems related to MC-124241
You have to do:
for the command to work as expected. The @a selector changes the executing entity, basically overwriting the previous "as @a[tag=bug]". @s uses the currently selected entity, which in this case is now @a and not @a[tag=bug]. Doing:
will not work since I'm assuming you want all players to see a title with the name of another player that died.