Village + Villager API 1.0

A library plugin for villages and villagers

  1. Jannyboy11
    Tested Minecraft Versions:
    • 1.8
    Don't use this plugin if you're not using CraftBukkit/Spigot 1.8! Bukkit has had a villager trade API since Minecraft 1.9, use that instead.

    Description


    A library plugin that allows other plugins to customize villagers from their java code. It also allows plugins to request information about villages.

    Usage

    First, you need to install the VillageUtilities.jar on your server. Then in your plugin.yml you need to add "VillageUtilities" to your dependencies, and in your project add VillageUtilitiesApi.jar to your classpath.

    In your code you can use the api like this:

    Code (Java):

    @Override
    public void onEnable() {
        VillageApi villageApi = (VillageApi) getServer().getPluginManager().getPlugin("VillageUtilities");
    }
     
    From there you can access the villages in a world like this:

    Code (Java):

    VillageSystem villages = villageApi.getVillages(Bukkit.getWorld("world"));
     
    You can consult the javadoc on what you can do with this VillageSystem object.

    From there you can access the villages in a world like this:

    Code (Java):

    CustomizableVillager cVillager = villageApi.getCustomizableVillager(/* some instance of org.bukkit.entity.Villager here */);
     
    The CustomVillager object can then be used to modify the trades. For all possibilities, please consult the javadoc.

Recent Updates

  1. Added javadoc!