Vault API is there a way i can check when player receive money?

Discussion in 'Plugin Development' started by EnchantedMiners, Oct 21, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    EnchantedMiners

    So what i want to know is if there is a way to check when the player receive money like an event so when the player receive money it change the amount to double ?
     
  2. Offline

    RingOfStorms

    Depends on what 'money' is in your context. There are probably hundreds of different plugins that claim some sort of currency or money. This means that there are even more ways a player could get this money.

    http://dev.bukkit.org/bukkit-plugins/vault/ Vault may be a good place to start.
     
  3. Offline

    EnchantedMiners

    RingOfStorms my title says Vault API 0.0, i think that it means i use Vault API
     
    RingOfStorms likes this.
  4. Offline

    FerusGrim

    After a cursory glance at Vault, I'm not seeing a way to 'listen' for a player to receive money.

    Maybe Sleaker could provide a more positive response.
     
  5. Offline

    xTigerRebornx

    FerusGrim You could take the current implementation of Vault's Economy (get however you'd like), and wrap it in an implementation that fires an Event on the method call, then set the wrapped implementation for others to use (the same way Vault sets the implementation)
     
  6. Offline

    xMrPoi

    You could make a scheduler that goes off every few seconds that saves all player's balances on the server. Each time it goes off, compare the previous balance to the current one. If it is different, do whatever you need to do. Then save the current balance again. This might be an iffy way of doing it but it would work.

    EDIT: I just reread your post and you said you wanted to double the amount the player receives. After checking if the balance has changed, if money was added, add that amount to the player's balance.
     
  7. EnchantedMiners I don't remember how it was done nor do I remember where he posted it, but fireblast709 made a simple plugin that did this - why not ask him ;)
     
  8. Offline

    fireblast709

    AdamQpzm likes this.
Thread Status:
Not open for further replies.

Share This Page