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 levels.yml file: economy: CUSTOM
Here is an example of a class to add your own economy
1
import fr.maxlego08.zauctionhouse.api.event.events.economy.*
2
​
3
public class CustomEconomy implements Listener {
4
​
5
@EventHandler
6
public void getMoney(EconomyMoneyEvent event){
7
Player player = event.getPlayer();
8
//Your method of recovering the player's money
9
event.setMoney(500);
10
}
11
12
@EventHandler
13
public void currencyEvent(EconomyCurrencyEvent event){
14
event.setCurrency("you currency");
15
}
16
17
@EventHandler
18
public void depositeEvent(EconomyDepositEvent event){
19
Player player = event.getPlayer();
20
double value = event.getMoney();
21
//Your method of giving money to a player
22
}
23
24
@EventHandler
25
public void withdrawEvent(EconomyWithdrawMoney event){
26
Player player = event.getPlayer();
27
double value = event.getMoney();
28
//Your method of withdrawing money from a player
29
}
30
31
}
Copied!
Last modified 4mo ago