Expressions

Expressions are a special feature of the CustomOreGen xml parser. Any attribute value that begins with &quot;:=&quot; is evaluated as an expression and the result is then assigned to the attribute.

Expressions can contain literal numbers or other values as well as mathematical symbols and functions, logical comparisons, string concatenation, and many other operations.

Config options, World Properties, and Mystcraft Symbols may be used like variables. The name of the option/property/symbol is replaced by its current value in the expression. The special variable &quot;_default_&quot; is also available, containing the default value of the attribute being set.

Expression values fall into 3 basic types: numerical, string, or boolean. It is the user's responsibility to keep them straight and to make sure that operators and functions are being used with values of the correct type. Use the conversion operators #, $, and ? when necessary to convert between types.

Some examples: := 42 := 5 * 3 + 6 := 5 * (3 + 6) := max(12,-19) : = _default_ * 3.2 : = &quot;Hello&quot; ~ &quot;World&quot; : = someConfigOption &gt;= 17.76 : = world.height / 2 : = &quot;foo&quot; != &quot;bar&quot; : = #&quot;6.2&quot; + 5.4