Currency Creation - MichaelFedora/FedorasEconomy GitHub Wiki
Currency config files are stored under [server directory]/config/currencies
, as [name].currency
files.
They are formatted as HOCON files, which is like JSON but not quite!
Sample
bigNumSeparator {
color=gray
text=","
}
displayName {
color=aqua
text=Fedorian
}
identifier="currency:fedorian"
pluralDisplayName {
extra=[
{
color=aqua
text=Fed
},
{
color="dark_gray"
obfuscated=true
text=ori
},
{
color=aqua
text=ans
}
]
text=""
}
rightSideSymbol=true
symbol {
color=aqua
text="f$"
}
valueFormat {
color="dark_gray"
text=""
}
valueScale=3
Legend
A string value is one that takes a word or sentence. This is usually encompassed by quotes "
. I.e. strval="value"
- Note: In HOCON, if it is one word, you don't have to use quotations. If it is more than one word, use quotations. If in doubt, use quotations.
A number value is one that takes a number. I.e. numval=9001
A formatted text object is a little more complicated. It has three sections which are all combined into one object: color
, style
, and the text
value which is simply a string. It also has an "extra" field where you can tack on extra text-objects with different formattings.
Sample:
text={
italic=true
color=aqua
text="hello "
extra=[
{
obfuscated=true
strikethrough=true
text="world"
color="dark_gray"
},
{
text="!"
color="lime_green"
bold=true
}
]
}
Note: When using multiple "extra" objects it may be better to use only the extra field, as sometimes it will mess up and put the parent's text after the extra objects.
Descriptions
bigNumSeparator
A text object which is a sperator that is placed every so often (specified by valueScale) after the decimal point. Usually this is a comma or a period. I.e. 7[bgs]654[bgs]321.123456789
. The formatting (not symbol) is also carried over to the decimal point.
The decimal point is not customizable at this time. Request it in an issue if you want it to be so!
displayName
A text object that is the display name of the currency. I.e. Deposited $1 [displayName] into your account
identifier
This is the a string which holds the identifier of the currency, i.e. if you are referencing it from a plugin or from the chat commands. I.e. /pay [user] 200 [identifier]
pluralDisplayName
A text object that is the plural display name of the currency. I.e. Desposited $200 [pluralDisplayName] into your account
rightSideSymbol
Whether or not the symbol is on the right side. Default is false. I.e. case true: 100$
case false: $100
symbol
A text object which represents the symbol of the currency. I.e. Deposited [symbol]100 [currency] into your account
valueFormat
A text object which holds the format of the value (numbers). The text part is not used, but is recommended to be an empty string.
valueScale
A number which represents the scale of how many digits to skip before putting a bigNumSeperator
in.