hInventoryAPI 1.0.8

a very useful inventory api for bukkit developers

  1. hakankargin
    Tested Minecraft Versions:
    • 1.7
    • 1.8
    • 1.9
    • 1.10
    • 1.11
    • 1.12
    • 1.13
    • 1.14
    • 1.15
    • 1.16
    Source Code:
    https://github.com/hakan-krgn/HInventory
    Contributors:
    Hakan Kargın
    What is the hInventoryAPI

    hInventoryAPI is a very useful InventoryAPI for bukkit developers. hInventoryAPI doesn't need to be added to plugins folder. Include the API in the project and then add "InventoryAPI.setup(this);" to onEnable event of your plugin.


    Maven and Gradle
    Code (general (Unknown Language)):
    <dependency>
        <groupId>com.github.hakan-krgn</groupId>
        <artifactId>HInventory</artifactId>
        <version>VERSION</version>
    </dependency>

    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>

    Example Codes
    Code (Java):
    Player player = Bukkit.getPlayer("playerName");

    HInventory hInventory = InventoryAPI.getInventoryManager().setTitle("aa").setCloseable(false).setSize(3).setId("bb").create();

    hInventory.setItem(11, ClickableItem.of(new ItemStack(Material.APPLE), (event) -> {
        player.playSound(player.getLocation(), Sound.VILLAGER_IDLE, 1, 1);
        player.sendMessage("§enormal item !");
    }));

    hInventory.setItem(13, ClickableItem.of(new ItemStack(Material.DIAMOND), (event) -> {
        player.playSound(player.getLocation(), Sound.LEVEL_UP, 1, 1);
        player.sendMessage("§agood item !");
        hInventory.close(player);
    }));

    hInventory.setItem(15, ClickableItem.of(new ItemStack(Material.MAP), (event) -> {
        player.playSound(player.getLocation(), Sound.ANVIL_LAND, 1, 1);
        player.sendMessage("§cbad item !");
    }));

    hInventory.open(player);
    Code (Java):
    Player player = Bukkit.getPlayer("playerName");

    HInventory hInventory = InventoryAPI.getInventoryManager().setTitle("a").setCloseable(false).setSize(5).setId("b").create();

    Pagination pagination = hInventory.getPagination();

    pagination.setItemSlots(Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35));

    List<ClickableItem> clickableItemList = new ArrayList<>();
    for (int x = 1; x < 903; x++) {
        int finalX = x;
        clickableItemList.add(ClickableItem.of(new ItemStack(Material.DIAMOND), (event) -> {
            Bukkit.broadcastMessage(finalX + "");
        }));
    }
    pagination.setItems(clickableItemList);

    hInventory.setItem(38, ClickableItem.of(new ItemStack(Material.ARROW), (event) -> {
        player.playSound(player.getLocation(), Sound.CLICK, 1, 1);
        pagination.previousPage();
    }));

    hInventory.setItem(40, ClickableItem.of(new ItemStack(Material.BARRIER), (event) -> {
        player.playSound(player.getLocation(), Sound.CLICK, 1, 1);
        hInventory.close(player);
    }));

    hInventory.setItem(42, ClickableItem.of(new ItemStack(Material.ARROW), (event) -> {
        player.playSound(player.getLocation(), Sound.CLICK, 1, 1);
        pagination.nextPage();
    }));

    hInventory.open(player);
    Wupin, AlperenX3 and Tau like this.

Recent Reviews

  1. Breakthrough
    Breakthrough
    5/5,
    Version: 1.0.4
    Excellent InventoryAPI. I use this in many of my plugins. Keep up the good work.
  2. bioflugel
    bioflugel
    5/5,
    Version: 1.0.4
    Hakoş be yapıyo adam

    80 karakter limiti
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  3. Veens
    Veens
    5/5,
    Version: 1.0.4
    THAT IS THE BEST API I HAVE SEEN.

    SORRY FOR MY BED ENGLAND , I SELLED MY WIFE FOR THIS API.