[API] KitAPI 1.0

This API lets you easily create a Kit for KitPvP or something else where you need kits!

  1. KojelinHD
    A small code how to use this API:

    NOTE: I'll upload the file when I've finished coding it!

    Code (Text):
    package net.kojelinhd.kitapi.main;

    import net.kojelinhd.kitapi.Kit;
    import net.kojelinhd.kitapi.KitManager;
    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.Material;
    import org.bukkit.inventory.ItemStack;
    import org.bukkit.inventory.meta.ItemMeta;
    import org.bukkit.permissions.Permission;
    import org.bukkit.plugin.java.JavaPlugin;

    import java.util.HashMap;

    public class Main extends JavaPlugin {

        /********************************************************
         * NOTE: THIS PLUGIN ONLY CONTAINS A KIT-SYSTEM!        *
         *       THAT MEANS YOU HAVE TO CODE OTHER FEATURES     *
         *       LIKE A GUI (INVENTORY) OR SOMETHING ELSE!      *
         ********************************************************/

        //Enable Method - nothing special
        public void onEnable() {
     
            // Startup Message
            Bukkit.getConsoleSender().sendMessage("§8[§aKitAPI§8] §aenabled!");

            //Item and Meta
            ItemStack item = new ItemStack(Material.APPLE);
            ItemMeta meta = item.getItemMeta();
            meta.setDisplayName(ChatColor.BLUE + "TestItem");
            item.setItemMeta(meta);

            //Items for one / or more than one (as you can see) kit/s
            HashMap<Integer, ItemStack> items = new HashMap<Integer, ItemStack>();
            items.put(1, item);
            items.put(2, new ItemStack(Material.BEDROCK));

            //Permission
            Permission perm = new Permission("kit.glowstone");

            //KitManager | IMPORTANT: Call it ONLY ONCE in your Code!
            KitManager km = new KitManager();

            // Kit "Glowstone"
            Kit kit = new Kit("Glowstone", new ItemStack(Material.GLOWSTONE_DUST), items, 0, perm);
            km.registerKit(kit); /* You have to register every Kit! */

            //Items for TestKit
            ItemStack displayItemTest = new ItemStack(Material.BEDROCK);
            ItemMeta testMeta = displayItemTest.getItemMeta();
            testMeta.setDisplayName("Test!");
            displayItemTest.setItemMeta(testMeta);

            //Create a Test Kit
            Kit test = new Kit("Test", displayItemTest, items, 0, perm);
            km.registerKit(test); /* Register it...*/

            //Create a second Test Kit |-|-| You can have as many Kits you want!
            Kit test1 = new Kit("Test2", new ItemStack(Material.APPLE), items, 0, perm);
            km.registerKit(test1); /* Register it too!! | Dont forget!! ;) */

            //Output to test my Code
            System.out.println("List Kits as names:                       " + km.getRegisteredKitNames());
            System.out.println("List Kits as integer:                     " + km.getRegisteredKitsInInteger());
            System.out.println("Price of 'Test':                          " + km.getKitPrice(test));
            System.out.println("Permission of 'Test':                     " + km.getPermission(test).getName());
            System.out.println("Name of the display-item from 'Test':     " + km.getKitIcon(test).getItemMeta().getDisplayName());
            System.out.println("Displayname of items of 'Test', Level 1:  " + km.getItemsDisplayNames(test, 1));
            System.out.println("Items of 'Test', Level 2:                 " + km.getItems(test, 2));
        }

        //Disable Method - also very special xD!
        public void onDisable(){
            //Shutdown Message
            Bukkit.getConsoleSender().sendMessage("§8[§eKitAPI§8] §edisabled!");
        }

    }
     

Recent Reviews

  1. Sheaq
    Sheaq
    5/5,
    Version: 1.0
    I am starting a few days with coding and this is really helpfull, for making a Kit plugin with scoreboard etc. :D
  2. JordyPwner
    JordyPwner
    1/5,
    Version: 1.0
    Bad. Should have it in main. Also why need this if u already can make easy kits. If u make a api then make something good and useful