Skip to content

Latest commit

 

History

History
25 lines (22 loc) · 629 Bytes

README.md

File metadata and controls

25 lines (22 loc) · 629 Bytes

CoinsAPI

BananaCrafts Economy plugin

API Usage Sample

@Getter
public class Main extends JavaPlugin implements Listener {
    private CoinsAPI coinsAPI;

    @Override
    public void onEnable() {
        coinsAPI = CoinsAPIPlugin.INSTANCE.getCoinsAPI();
        Bukkit.getPluginManager().registerEvents(this, this);
    }

    //Gives player 500 coins on first join.
    @EventHandler
    public void onJoin(PlayerJoinEvent event) throws SQLException {
        Player p = event.getPlayer();
        if (!coinsAPI.doesPlayerExist(p.getName())) {
            coinsAPI.addCoins(p.getName(), 500);
        }
    }
}