I have a config file wich looks something like this:
In my old code I just used
to give me a String with colour information on which I later used String#replace to change the '%Player%' to the actual player name...
Now I want to use components.
I know how to make colourful components, but I don't know how the user could set the colours easily in the config file.
Can you give me a hint how this could be implemented?
YAML:
# colour codes start with &
# variables are enclosed by %
Messages:
NoPermission: '&4Denied access! You are not allowed to do this.'
Join: '&a>>&7 %Player%'
...
In my old code I just used
Java:
ChatColor.translateAlternateColorCodes('&', config.getString("Messages.Join"))
Now I want to use components.
I know how to make colourful components, but I don't know how the user could set the colours easily in the config file.
Can you give me a hint how this could be implemented?
- Version Output
- 1.20.2