Detect when other plugins change player's economy with Vault

Discussion in 'Spigot Plugin Development' started by zozidalom, Jun 24, 2018.

Thread Status:
Not open for further replies.
  1. Hello,

    Is there any chance how I could detect when another plugin changes a player's balance via Vault?
     
  2. Only if they call their own events. I used to use SaneEconomy on my server because it had events. They sadly removed them, though, so we lost this ability. I eventually just made my own economy plugin so I could fire off events and be in total control *insert evil laugh*
     
    • Informative Informative x 1
  3. (Not the best way)
    Because not all the economy plug-ins support events you can just create a class that implements listener and when a player join put him in an Hash Map with his UUID and his balance. In your onEnable schedule a BukiutRunnble that every second loops through all the online players and checks if their balance is equal to the one on the Hash Map, if not do something
     
    • Informative Informative x 1
  4. You can try and make a fork of Vault, add your events, add dispatching them where you want them to be dispatched, compile changed plugin and put it on the server.
     
    • Informative Informative x 1
  5. Alright, thank you guys!
     
Thread Status:
Not open for further replies.