DonationAlertsAPI icon

DonationAlertsAPI -----

Simple plugin that allows work with received donations



The concept of the plugin is very easy.
When you receive a new donation, it triggers AsyncDonationEvent.

Some examples:
Code (Java):
    @EventHandler
    public void onDonation (AsyncDonationEvent e ) {
        Donation donation = e. getDonation ( ) ;

        String username = donation. getUsername ( ) ;

        Currency currency = donation. getCurrency ( ) ;
        int amount = donation. getAmountMain ( ) ;

        if (currency == Currency. RUB && amount >= 500 ) {
            Bukkit. getOfflinePlayer (username ). setWhitelisted ( true ) ;
        }
    }
Code (Java):
    @EventHandler
    public void onDonation (AsyncDonationEvent e ) {
        Donation donation = e. getDonation ( ) ;

        Currency currency = donation. getCurrency ( ) ;
        int amount = donation. getAmountMain ( ) ;

        if (currency == Currency. RUB && amount == 150 ) {
            new BukkitRunnable ( ) {
                @Override
                public void run ( ) {
                    for (Player player : Bukkit. getOnlinePlayers ( ) ) {
                        World world = player. getWorld ( ) ;

                        world. spawnEntity (player. getLocation ( ), EntityType. GHAST ) ;
                    }
                }
            }. runTask ( this ) ;
        }
    }
Resource Information
Author:
----------
Total Downloads: 191
First Release: Jul 3, 2021
Last Update: Jul 3, 2021
Category: ---------------
All-Time Rating:
0 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings