Reference to player from advancement run function
Hello! I am trying to make an advancement that runs when the player first joins the game. I have something working using this:
Continue to help post"criteria": { "joined_server": { "trigger": "minecraft:tick" } }, "rewards": { "experience": 500, "function": "root:player_joined" }
I placed the function player_joined.mcfunction under the functions folder with this command:
give @s minecraft:diamond 10
The experience part of the reward worked but this command did not. I understand I can just add the diamond straight to the reward instead of doing it through a function but this function will grow with other commands and I just need to get this working to continue. The main issue, is the @s
correctly referencing the player?
Any advice or efficiency tips would be greatly appreciated! I am very worried about using functions to do much because of their impact on TPS for a larger server.