Links

Economy

Economy avaible

  • VAULT
  • PLAYERPOINT
  • TOKENMANAGER
  • MYSQLTOKEN
  • LEVEL
  • ITEM1
  • ITEM2
  • ITEM3
  • CUSTOM
  • OPTECO

Add your own economy

To add your own economy you have 4 events available, one to check if a player has enough money, one to recover the currency of your economy, one to withdraw money from a player and one to add money. money to a player.
You must also put your economy in CUSTOM in the config.json file: defaultEconomy: CUSTOM
Here is an example of a class to add your own economy
import fr.maxlego08.zauctionhouse.api.event.events.economy.*
​
public class CustomEconomy implements Listener {
​
@EventHandler
public void getMoney(EconomyMoneyEvent event){
Player player = event.getPlayer();
//Your method of recovering the player's money
event.setMoney(500);
}
@EventHandler
public void currencyEvent(EconomyCurrencyEvent event){
event.setCurrency("you currency");
}
@EventHandler
public void depositeEvent(EconomyDepositEvent event){
Player player = event.getPlayer();
double value = event.getMoney();
//Your method of giving money to a player
}
@EventHandler
public void withdrawEvent(EconomyWithdrawMoney event){
Player player = event.getPlayer();
double value = event.getMoney();
//Your method of withdrawing money from a player
}
}