Virtual Currency

LightCoins provides a unlimited custom currency system.

What is a custom currency?

A virtual currency is an additional currency alongside the default Vault currency that players can use. LightCoins supports unlimited custom currencies. You can add or remove these currencies for players using commands or the LightCoins API. Each custom currency has its own .yml file where all settings can be configured.

Example custom currency file

This file will be generated by lightCoins as a template. _example files will not be loaded.

#   ########################################################################################  #
#
# This file is generated with LightCore used in LightCoins
#
#    ___       ___  ________  ___  ___  _________  ________  ________  ________  _______
#   |\  \     |\  \|\   ____\|\  \|\  \|\___   ___\\   ____\|\   __  \|\   __  \|\  ___ \
#   \ \  \    \ \  \ \  \___|\ \  \\\  \|___ \  \_\ \  \___|\ \  \|\  \ \  \|\  \ \   __/|
#    \ \  \    \ \  \ \  \  __\ \   __  \   \ \  \ \ \  \    \ \  \\\  \ \   _  _\ \  \_|/__
#     \ \  \____\ \  \ \  \|\  \ \  \ \  \   \ \  \ \ \  \____\ \  \\\  \ \  \\  \\ \  \_|\ \
#      \ \_______\ \__\ \_______\ \__\ \__\   \ \__\ \ \_______\ \_______\ \__\\ _\\ \_______\
#       \|_______|\|__|\|_______|\|__|\|__|    \|__|  \|_______|\|_______|\|__|\|__|\|_______|
#
# -> powered LightCoins - A simple and lightweight coins / virtual currency plugin for your server.
#    Copyright © 2024 LightStudios
#
#   This is the example virtual currency config. You can use this file as a template for your own currency.
#   This currency will NOT load and is only here for example purposes.
#   The file name is the ID of the currency -> '_example'
#   You can also create multiple folders within 'virtual-currencies' to group your currencies.
#
#   IMPORTANT: If you DELETE one file, this currency will still exist in the database!
#              If you create a new currency with the same ID as in the database,
#              the old data from the database will be used.
#
#   If you have any problems, join my discord server (https://discord.gg/t9vS3hgWf8)
#
#   ########################################################################################  #
#
#
# The visual name in messages and GUIs
displayName: '<#ffdc73>Gems'
# The placeholder for the currency in messages.
placeholderFormat: '<yellow>#amount# <gray>#currency#'
# This is the starting balance for this
# currency when a new player joins the server.
startBalance: 0.00
# The decimal places for this currency.
# 2 means 0.00, 3 means 0.000 and so on.
# If you set this to 0, the currency will be displayed without decimal places.
decimalPlaces: 0
# visual currency name in messages and GUIs in plural
currencyNamePlural: 'Gems'
# visual currency name in messages and GUIs in singular
currencyNameSingular: 'Gem'
# The max possible money amount.
# If a player reaches this value, he can't get any more currency.
maxBalance: 999999999999999999999999
# The voucher system for the default currency.
# Players can create vouchers with a value between the min and max value.
# and redeem them for the currency with right-click.
voucher:
  # Enable or disable the voucher system for this virtual currency.
  enable: true
  # The command cooldown for the voucher command in seconds.
  commandCooldown: 5
  # The min value for the voucher to create.
  minValue: 100.00
  # The max value for the voucher to create.
  maxValue: 100000.00
    # The physical item for the voucher.
    # HOW TO: In /LightCoins/items/.. you can create the item.
    # This is the file name without the extension.
    # example: 'voucher-item' (/LightCoins/items/voucher-item.yml)
  item: token

How do i create my own virtual currency ?

  1. Copy and paste the _example.yml file, then rename it to match your currency's name. This file is located in /lightCoins/virtual-currency/_example.yml. If you have more than one Server, you must create them on every Server.

  2. Open your newly created file and adjust the values to your preferences. Every setting is described within the file. Don't forget to save the file after editing it.

  3. Now restart your server (do not reload it!). After creating a new file, you can make changes without restarting the server -> just use /lightcoins reload.

How do i delete a virtual currency ?

Similar to the method for creating a virtual currency, simply delete the file and restart the server. The current balances of the deleted currency will still be stored in the database. If you recreate the currency later using the same file name, all balances will be restored.

Last updated