Creating a custom inventory

Discussion in 'Plugin Development' started by 1337, Sep 4, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    1337

    Im trying to make a mod that can show the content of a custom item from a mod. The size of the inventory is 113 itemstacks. Ive tried with extending playerinventory, and, while it works, its all shifted upwards, so most of the inventory is missing, as it also shows the players inventory underneath, along with the custom inventory. I also tryed to make my own Inventory class, extending IInventory, but It doesnt show anything when I use this class.
     
  2. Offline

    md_5

    Bukkit.getServer().createInventory(...)
     
  3. Offline

    1337

    You cant you player.openContainer(inv) with that, as it cant be cast to IInventory from Inventory
     
  4. Offline

    Ammar Askar

    There is no openContainer method in the bukkit Player class, I'm assuming you're referring to the nms EntityHuman's openContainer.

    You should be using player.openInventory
     
  5. Offline

    1337

    When using that, it opens the players inventory and the custom inventory at the same time

    Code:
    Inventory inv = Bukkit.getServer().createInventory(p, 108, "alcbag_" + p.getDisplayName());
    p.openInventory(inv);
    Ok, im using inventoryview now, but the player inventory and my custom on are to big to fit together on screen, and causes the gui to offset, im not sure how to fix this

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 28, 2016
  6. Offline

    Firefly

    Isn't it player.showInventory() or something like that?
     
Thread Status:
Not open for further replies.

Share This Page