Can't refresh Inventory

Discussion in 'Plugin Development' started by Casinator, Mar 1, 2020.

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

    Casinator

    Hello! I'm trying to code a custom crafting plugin, but every time I change the Inventory to craft in, I can pickup the result, but it's invisible. I made a constructor for an object called CraftInventory, the inventory to craft in. I already tried inv.setContents(inv.getContents);
    Plz help
     
  2. Offline

    wand555

    Maybe try and update the inventory one tick later.
     
  3. Offline

    Lightcaster5

    Have you tried player#updateInventory?

    EDIT:
    Here's some example usage:
    Code:
        public void giveSword(Player player) {
            player.getInventory().addItem(new ItemStack(Material.DIAMOND_SWORD));
            player.updateInventory();
        }
     
Thread Status:
Not open for further replies.

Share This Page