The last 4 weeks I was learning java at school, since it’s vacation now I want to learn to develop Sponge Plugins to get more knowledge of Java. I don’t have experience with Bukkit.
I already made a small plugin that creates a house when an command is used.
Now my question:
I’m making a small Tag plugin where people can start a game if one doesn’t exist and join one if it does exist. I made these subcommands:
I’m wondering how to change a variable “gameStarted” that is created in the main class from the CmdTagStart class.
I already tried making the variable public but, as I expected, it doesn’t know about this variable.
How to make a variable global and/or change the variable from another class?
And is this the best way to keep track of the states of the game or should I save the variables elsewhere.