[Datapack] Attempting to make a Kit PVP kit selector via dialogs (1.21.6)
I have been trying to make a system for kit pvp that allows the selection of kits using a dialog, and only allowing one player each to select each kit. Currently, when the quick actions key (G) is pressed, it will bring up a dialog that displays each kit as a button, which runs a function that gives a tag and any given items. There are also passive abilities, which are activated when someone runs a function that "starts" the game. This also keeps track of a in-minigame "time". (the check for duplicate kits has not been added yet)
This has worked fine for testing, although it is slightly annoying with the "Confirm Command Execution" screen. However, the main problem is that the function command needs operator permissions to run, which would not be ideal for running the datapack in a multiplayer setting, which is its intended purpose.
The only way around this I believe would be using the /trigger command, as it can be run by non-operators. But, the main issue is that it can only store to a scoreboard. I had thought that I could have each button store a different number, and within the first few ticks of "minigame time" it would then check players scores, and give them the kit based on the corresponding number. This would not allow for a duplicate kit check, however. -# note: duplicate kits will not function properly, nor are they intended
If anyone has any potential solutions, it would be greatly appreciated.