Home›Java›Mods›MineConomy
MineConomy
MineConomy

Description

welcome to my first economy API / library I hope you may help me to improve my code just contact me at spigot .

Tutorial How to use it

Firstly get the balance class instance using this code

Code (Java):
Balance balance = Balance. Balance ( ) ;
Now lets try to use all feautures .
Firstly make your own insufficient balance using a listener

You must not forgot to implements listener your class

Code (Java):
public YourClass implements Listener
You must not forgot @EventHandler also
This is the usage of the Event

Code (Java):
@EventHandler
public void onEvent (InsufficientBalanceEvent e ) {

// set the insufficient balance message error
  e. setInsufficientMessage ( String msg ) ;

}
You may set the player's balance by doing this

Code (Java):
balance. set (Player p, int amount ) ;
Add amount to player's current balance

Code (Java):
balance. add (Player p, int amount ) ;
Reset player's balance from doing this

Code (Java):
balance. reset (Player p ) ;
Withdraw a balance to player by using this

// Note you have no need to worried if the player has not enough balance the insufficientbalance event will throws
Code (Java):
balance. withdraw (Player p, int amount ) ;
Transfer player's balance to another player

Code (Java):
balance. transfer (Player sender, Player target ) ;
// the sender is the one who will send the money and the target player will get the sender's money

Get the player's uuid

Code (Java):
balance. getData ( ). getUUID (Player p ) ;

Get the player's balance (int)

Code (Java):
balance. get (Player p ) ;
You must not forgot this at your onEnable()

Code (Java):
if (Bukkit. getServer ( ). getPluginManager ( ). getPlugin ( "MineConomy" ) == null ) {
Bukkit. getLogger ( ). severe ( "Disabled due to no dependancy found" ) ;
Bukkit. getServer ( ). getPluginManager ( ). disablePlugin ( this ) ;
return ;
}
You must not forgot this at your plugin.yml also

Code (Java):
softdepend : [MineConomy ]
// or
depend : [MineConomy ]
Developer Message

after using my api as a dependancy :p I hope you may simply do a review and include the link of your plugin .​
Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

MineConomy is a free Minecraft Java mod. Downloaded 980 times (via Spigot). Download it and open it directly in the game.

Explore more