How can you do it with Minecraft plugins so that if the config is empty or incorrect, a certain text is written in?

gl
- in Plugins
4

How can you do it with Minecraft plugins so that if the config is empty or incorrect, a certain text is written in?

an

If (getConfig (). GetKeys (false) .size () == 0) {
getConfig (). Set ("DeinKey", derWert);
}

gl

What does the false do with getKeys ()?

an

To see if the whole config is empty, and not just the part.

If deep is set to true, then this will contain all the keys within any child ConfigurationSections (and their children, etc). These will be in a valid path notation for you to use.

If deep is set to false, then this will contain only the keys of any direct children, and not their own children.

https://hub.spigotmc.org/...ction.html

gl

OK thanks