I want to program a plugin for the game "Minecraft".
Now I want, if the player "ABC" makes the command "/ cmd CBA", that then an ID is generated (eg "AHC71") and saved in the config as follows:
CBA:
ID: AHC71
If an ID is generated which already exists in the config, a new one should be generated and set to the player in the config.
How exactly can I do that?
PS: The ID should contain letters & numbers, but should max. 9 characters long.
Question about individual steps that you can't handle.
Ok… So how exactly can I save this data in the config as I wrote it above?
Get the rest I think.
Most likely, the API you use for the plugin has interfaces for it.
This could be achieved with a YAML configuration file. Programmatically, a HashMap made of an integer and string would be a good choice. The lengths and doubling of the IDs you could solve with simple if queries.
I managed that now. However, I somehow do not get it to read out the IDs of the players and send.
So I have it now in the "id.yml" saved:
NAME: 18384
Now I would like to query with a command whether the ID of args [0] exists in the id.yml. Can you help me with that?
Take a look at this spigot documentation page: https://hub.spigotmc.org/...ation.html