HeadIndex Mod Kicked Off with a Button

Hello!

I am working to get the HeadIndex mod to be kicked off by a button push. I have that working but I have 2 questions/problems.

  1. I have a called function that executes this command: execute as @p run head

Where is the @p centered? Is that the correct (or most correct) target for the function? The center for the function does not appear to be the button. For example I am standing in front of the button and I press it. A person behind me gets the menu.

  1. How do I have a function call only run once? Since I have the call on the tick, it opens the menu multiple times.

Here is the code I am working with.


tick.mcfunction execute if block 382 68 -2473 minecraft:oak_button[powered=true] run function headindex:headmenu


headmenu.mcfunction execute as @p run head


load.json { "replace": false, "values": [ "headindex:load" ] }


tick.json { "replace": false, "values": [ "headindex:tick" ] }

Continue to help post