I would have a lot more possibilities if I could add variables to my commands. Is there anyway to do this?

I have tried to use armor stands but it requires a command block for every single possibility.


Solution 1:

Since JSON does not directly allow the use of variables, you could create scoreboard objectives using /scoreboard objectives add objname dummy displayname to add the objective, /scoreboard players add playername objname num to add scores, and /scoreboard setdisplay location objname to set where the objective is displayed, which is optional.