How to use PremiumLevels API
The plugin simply allows any other plugin to easily call it using a simple API. To use the API, add the jar of the plugin and the following line in your plugin :
Code (Text):
PremiumLevels premiumLevels = (PremiumLevels) Bukkit.getServer().getPluginManager().getPlugin("PremiumLevels");
What the API can do
Using the API, you can now do the following :
- Add experience to a player :
Code (Text):
premiumLevels.getPlayerLevel(player).addExperience(double);
- Set the experience of a player :
Code (Text):
premiumLevels.getPlayerLevel(player).setExperience(double);
- Add levels to a player :
Code (Text):
premiumLevels.getPlayerLevel(player).addLevel(int);
- Set the level of a player :
Code (Text):
premiumLevels.getPlayerLevel(player).setLevel(int);
- Get the experience of a player :
Code (Text):
double experience = premiumLevels.getPlayerLevel(player).getExperience();
- Get the level of a player :
Code (Text):
int level = premiumLevels.getPlayerLevel(player).getLevel();