DKCoins V1 is no longer supported and maintained. Checkout the new DKCoins V5 here
Official page: https://www.spigotmc.org/resources/dkcoins-coinsystem-mysql-sqlite-mongodb-json-german-english.39159/
- Download the current version from SpigotMC.
- Put the plugin in your spigot plugin folder.
- Restart your server.
- Select a storage type (More informations below).
- restart your server.
The BungeeCord plugin is only a API, it has no commands.This is very interesting when you have a BungeeCord plugin, which needs Coins.
- Download the current version from SpigotMC.
- Put the plugin in your BungeeCord plugin folder.
- Restart your server.
- Select a storage type (Use the same storage and database, then your spigot server. BungeeCord has no json support).
- restart your server.
There are four storage options, json is not supported for BungeeCord.
storage:
folder: plugins/DKCoins/data/
type: SQLITE
host: localhost
port: '3306'
user: root
password: YourPassword
database: DKCoins
mongodb:
mongodbauthentication: true
authenticationDatabase: test
srv: true
Replace the password and user to your data.
storage:
folder: plugins/DKCoins/data/
type: MYSQL
host: localhost
port: '3306'
user: root
password: YourPassword
database: DKCoins
mongodb:
mongodbauthentication: true
authenticationDatabase: test
srv: true
Replace the data to your data.
storage:
folder: plugins/DKCoins/data/
type: MONGODB
host: localhost
port: '27017'
user: root
password: YourPassword
database: DKCoins
mongodb:
mongodbauthentication: true
authenticationDatabase: admin
srv: false
Replace the data to your data.
storage:
folder: plugins/DKCoins/data/
type: JSON
host: localhost
port: '27017'
user: root
password: password
database: DKCoins
mongodb:
mongodbauthentication: true
authenticationDatabase: admin
srv: false
//by ID
CoinPlayer player = CoinSystem.getInstance().getPlayerManager().getPlayer(int id);
//by UUID
CoinPlayer player = CoinSystem.getInstance().getPlayerManager().getPlayer(UUID uuid);
//by Name
CoinPlayer player = CoinSystem.getInstance().getPlayerManager().getPlayer(String name);
player.getName(); //returns the player name
player.getUUID(); //returns the player uuid
player.getID(); //returns the player id
player.getCoins(); //returns the coins amount
player.getColor(); //returns the player color
player.getFirstLogin(); //returns the first login as timestamp
player.getLastLogin(); //returns the last login as timestamp
player.setCoins(long coins);
player.setCoins(long coins, CoinsUpdateCause cause);
player.setCoins(long coins, String message);
player.setCoins(long coins, CoinsUpdateCause cause, String message);
Set, remove and add have the same methodes.
player.addCoins(long coins);
player.removeCoins(long coins);
The CoinsUpdateCause and message is to identify the coin change in the event.
Available CoinsUpdateCause
- ADMIN
- API
- PAY
Use the event as normal Bukkit or BungeeCord event.
Event options
event.getCoinPlayer(); // get the player
event.getCause(); //get the update cause
event.getMessage(); //get the update message
event.getOldCoins(); //get the coins before the change
event.getNewCoins(); //get the new coin amount
event.isCancelled(); //check if the event is cancelled
event.setCancelled(boolean cancel); //cancel the event
event.setCoins(long coins); //set the new coin amount.
Use the event as normal Bukkit or BungeeCord event. The event will be executed, when the player gets a color
Event options
event.getPlayer(); // get the player
event.getColor(); //get the update cause
This project is licensed under the Apache License - see the LICENSE file for more informations.