API

Feb 27, 2017
API
  • API for developers

    This is first version of the API. Please create a ticket on Github if you need more features or help.

    1) Add softdepend: [MobHunting] or depend: [MobHunting] to your plugin.yml

    2) Add to your code:
    Code (Text):
    public MobHuntingAPI mobHuntingAPI;
    @Override
    public void onEnable() {
        Plugin mobHunting = Bukkit.getServer().getPluginManager().getPlugin("MobHunting");
        if ((mobHunting != null) && (mobHunting.isEnabled())) {
            mobHuntingAPI = new MobHuntingAPI();
        }
    }
    Implemented events:

    MobHuntKillEvent(HuntData huntData, DamageInformation info, LivingEntity deadEntity, Player killer)

    • Huntdata contains information about the kill (reward, killstrike...)
    • DamageInformation about damage (weapon)
    • DeadEntity is the mob/player who was killed.
    • killer is the player who kiled the deadEntity

    MobHuntFishingEvent(Player player, Entity fish, double cash, HashMap<String,Double> multiplierList)

    • player is the player who caught the fish
    • fish is the entity of the caught fish
    • cash is the basic reward for catching the fish
    • multiplierList is a list of multipliers (bonuses) activated for the player. The final price is cash*multiplier1*multiplier2*multiplier3*.....
  • Loading...
  • Loading...