Config
Plugin configuration files are split into separate files to organize options. All the config files are automatically reloaded.
Config files are not translatable but the language file and all the GUIs are.
Kingdoms uses YAML as its main config system.
For information specific to language files, refer to Languages section.
All the configs including language files except GUIs, support auto config updates. However this feature is disabled by default. When the auto updater is disabled, the plugin tries to use the default value.
Most config options are explained in their own config files. This page covers some basic and advanced features that the Kingdoms plugin supports in config options.
- Most numeric options can be disabled by setting their value to 0 (or lower) unless specified otherwise. This disables any side effects that the option might have (such as sending messages)
- You can use
\nline break to break lines for messages. - All the Minecraft materials can be found here.
- Potion effects are defined using the
<potion>, <duration>, <level> [%chance]whereis one of these and the duration is in seconds. Also the level doesn't start from 0 unlike the standards. The chance (the percent sign is required before it, but notice there's no comma) is from 0 to 100 - Sounds use the
[~][category@]<sound>, [volume], [pitch], [seed]format. All Minecraft sounds can be found here. Minecraft volume ranges from0.0to1.0, with1.0as the normal value. Any higher number only increases the radius in which players can hear the sound. Pitch ranges from0.5to2.0, with1.0as the normal value. You can test sounds with the /k admin sound command. The optional~prefix plays the sound at the player's location instead of only for that player, allowing nearby players to hear it too. The<sound>can also come from a resource pack and usually looks likerpname:my.custom.sound. - Options that you can specify commands for always take one or multiple commands.
- Singular like
commands: "k admin rp %kingdoms_name% add 100"orcommands: [ "k admin rp %kingdoms_name% add 100" ] - Multiple like
commands: [ "give %player% diamond 10", "give %player% grass 4" ] - The slash at the beginning of the commands are optional, but if you ever had to use a plugin which uses 2 slashes (such as
//wand) you have to use 3 slashes insteadcommands: "///wand" - There are two command directive prefixes that change the executor of the command:
OP:By default commands are executed as if the player executed them. Using this directive will make the player execute the commands as op.CONSOLE:This tells the server to execute the command from console. This is preferred over OP directive.- E.g.
commands: [ "CONSOLE:give %player% diamond 10", "OP:give %player% diamond 10" ]
- Singular like
- Surprisingly one thing that some people don't know, is that you can use Ctrl + F to search for something in a file. This is useful for searching for config options or language entries. If you didn't know this, Google Ctrl + Z and Ctrl + R as well.
- Most of the config options in the config that represent a time, support time suffixes. The default time suffix is seconds. Please also note that most of the cooldown options in the config are temporary, meaning that the timer will reset after server restarts. Some time suffixes:
- You might see some config options that only support ticks. In Minecraft each second is 20 ticks.
ms,millisec,millisecs,millisecond,milliseconds(Note: Due to the tick-based nature of Minecraft, not all options use this accurately)s,sec,secs,second,secondsm,min,mins,minutes,minutesh,hr,hrs,hour,hoursd,day,days- Example:
time-limit: 10days
Boss Bars
Boss bars are the progress bars that you usually see on the top of your screen when fighting withers and the ender dragon. You can test different values using the /bossbar vanilla command.
You can see both of them in this image:

Options:
enabledUsually this option is present to determine whether the bar should be shown at all or not.titleThe title of the bar which supports colors (including hex colors) and placeholders, but they do not support line breaks.colorThe color of the bar. You can find all the colors here.styleThe style of the bar. Bars can be either a solid line just like the ones shown in the image above, or segmented with indicators that divide the bar with small vertical lines. You can find all the styles here.flagsA list of cool visual side-effects. You can find all the flags here.
Styles:

Math
These rules apply to all the math equations in any configs.
After reading the basics, you can head to the practical section for a better understanding.
Simple Operations
Supports all the mathematical operators such as +, -, /, *, %, (), ^, etc...
/You should know this one! It's the division operator. Fractional numbers!%in computers, this is calledmodulowhich is basically theremainderof a division. For example,4 / 3has a remainder of1so4 % 3is1and4 / 2has a remainder of0so4 % 2is0*in computers meansmultiply^in computers usually refers to bitwise operators, but itexponentiateshere. E.g.2^3=2³=2 * 2 * 2=8
Sometimes you might encounter an error regarding the symbols that you used in a math equation being unknown.
These issues mostly happen when you're editing the config on a phone (for some reasons...) which can sometimes make you confuse symbols. For example, on iPhone, there is a symbol − technically named minus sign (U+2212), but on PC or android, the symbol is - named hyphen-minus (U+002D).
While both are correct, there may be other symbols that look similar and may cause math compiler issues.
They support Order of operations (Operator Precedence). Bitwise operator precedence are the same as Java's. E.g. 2 + 2 * 100 is 2 + 200 and not 4 * 100
You can test your equations with the /k admin evaluate command.
Placeholders
Placeholder support depending on the context. For example, in some cases only the kingdom is present with no player. That means you can use %kingdoms_lvl is a custom placeholder commonly used in equations. For more info, visit the linked wiki.
- The compiler also interprets boolean placeholders. Returning
1fortrueand0forfalse. This can be used with conditional functions. - They support integers, decimals and hexadecimals.
Functions
They also support all the Java Math functions (other than the functions with exact in their name which are useless anyway). You're definitely familiar with functions f(x), but here we will use meaningful names other than f to use functions. In order to understand this document, simply ignore the header description, just scroll down to read the method names. You'll see stuff like int, long, float and double next to the parameter names, they're all basically representing a number. int and long are numbers without decimals, and float and double are numbers with or without decimals. If a function requires an integer, it'll automatically convert into an integer if the passed parameter is a decimal by rounding it.
Some options rarely support equations for time formats. In these equations you can represent the time by surrounding it with square brackets. E.g. lvl * [1 day]
-
Special Functions:
- time() Gets the current time in milliseconds (since unix epoch).
- max(a, b, c, ...) Returns the greatest number from all the given arguments.
- min(a, b, c, ...) Returns the smallest number from all the given arguments.
- random(min, max) Get a random decimal number between the given minimum and the maximum numbers.
- randInt(min, max) Get a random integer number between the given minimum and the maximum numbers.
- whatPercentOf(x, y) Finds X is What % of Y which is equivalent to
(x / y) * 100 - percentOf(x, y) Gets X percent of Y which is equivalent to
(x / 100) * y - naturalSum(n) Calculates the natural sum from 1 to the given number.
- reverse(n) Returns the value obtained by reversing the order of the bits in the two's complement binary representation of the specified number.
- reverseBytes(n) Returns the value obtained by reversing the order of the bytes in the two's complement representation of the specified number.
- hash(n) Returns the hashcode of the argument.
- identityHash(n) Returns the identity hashcode of the argument.
- Conditional functions:
- eq(var1, var2, var3, var4) Gives
var3ifvar1is equal tovar2, otherwise it'll givevar4 - ne(var1, var2, var3, var4) Gives
var3ifvar1is not equal tovar2, otherwise it'll givevar4 - gt(var1, var2, var3, var4) Gives
var3ifvar1is greater thanvar2, otherwise it'll givevar4 - lt(var1, var2, var3, var4) Gives
var3ifvar1is less thanvar2, otherwise it'll givevar4 - ge(var1, var2, var3, var4) Gives
var3ifvar1is greater than or equal tovar2, otherwise it'll givevar4 - le(var1, var2, var3, var4) Gives
var3ifvar1is less than or equal tovar2, otherwise it'll givevar4
- eq(var1, var2, var3, var4) Gives
-
They support Bitwise Operations too. This is a more simplified version specifically for Java. However, some of them use a different operator since the operator system in the math evaluator works per a character. They might conflict if used in conditional GUIs.
&Bitwise AND operator|Bitwise OR operator!Bitwise XOR operator^~Bitwise Compliment Operator>Bitwise Binary Right Shift Operator>><Bitwise Binary Left Shift Operator<<$Bitwise Shift Right Zero Fill Operator>>>
Practical Math
When we say a math equation you'll normally expect to see something like the common Quadratic equation or a simpler Polynomial equation such as x + 3 = 10 (which would be x = 10 - 3), but in configs, the core concept is represented a little differently.
Let's say there's an option for the max number of members that can join your kingdom.
max-members: 10
Obviously this doesn't look really fun because a kingdom can only have 10 members no matter how big it is, so for this option, we're going to spice things up a little and use a math expression. We can use the %kingdoms_max_members% placeholder as our variable that the equation is going to be solved for and %kingdoms_2 members for every one land that they claimed.
max-members: %kingdoms_max_members% = %kingdoms_lands% * 2
While this looks logical, it's just redundant. If you look at the option name, it's already named max-members, so it's like you're writing
maxMembers = maxMembers = lands * 2
The point is that the option name itself is the variable that we're solving. We can rewrite this as:
max-members: %kingdoms_lands% * 2
There's one issue left, in equations the percent signs % are useless and even cause errors. Because instead they're interpreted as modulus operator ("operators" are things like plus + and multiply *) so you'll have to write:
max-members: kingdoms_lands * 2
Functions
Now if we wanted to get a little more advanced and say we want to cap this value at 50 members, we can use the function feature.
max-members: min(kingdoms_lands * 2, 50)
Now even if a kingdom claimed 100 lands (100 * 2 = 200) they'll only have 50 max members, because that's what the min() function is doing.
Functions are just like normal math functions f(x) the only difference is that their name is a little more obvious.
min(x, y) function is really simple. It says I'll take both x and y inputs and give you the minimum of the two values as the output. So for example min(3, 1) gives you 1 obviously because 1 < 3
For you math students out there, the equivalent mathematical definition would look like: