Unclosable Inv

Discussion in 'Plugin Development' started by MCMatters, Dec 15, 2015.

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

    MCMatters

    Code:
    @EventHandler
        public void onClose(InventoryCloseEvent e){
             Inventory inv = Bukkit.createInventory(null, 9, ChatColor.translateAlternateColorCodes('&', "&d&lWELCOME!"));
           
            e.getPlayer().openInventory(inv);
           }
    Works the first time then doesn't work
     
  2. Offline

    Zombie_Striker

    @MCMatters
    Can you be a little more descriptive in what you mean? What do you mean by "doesn't work"? What is different between the first and second time?
     
  3. Offline

    MCMatters

  4. Offline

    87pen

    10/10 Much descriptive, such inventory, wow.
    Does any inventory open? does the event fire? do you get any stack traces? Using this method any inventory they close will open your new one. Debug messages anywhere? What have you tried to fix this?
     
    Zombie_Striker and ReeseNator like this.
  5. Offline

    MCMatters

  6. Offline

    Irantwomiles

    I'm sure there is more to that error message.
     
  7. Offline

    RoboticPlayer

    You are trying to open an inventory at the exact moment in which they are closing their inventory. Put on a delay of a tick or two and that may solve your issue.
     
  8. Offline

    Zombie_Striker

    In case you don't have a link on how to delay the task; here.
     
Thread Status:
Not open for further replies.

Share This Page