Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-3865

Main thread death loop on teleport in InventoryCloseEvent (EventException: null)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None
    • Windows 7
      Java 9

      import org.bukkit.Bukkit;
      import org.bukkit.Location;
      import org.bukkit.Material;
      import org.bukkit.event.EventHandler;
      import org.bukkit.event.Listener;
      import org.bukkit.event.block.BlockPlaceEvent;
      import org.bukkit.event.inventory.InventoryCloseEvent;
      import org.bukkit.event.inventory.InventoryType;
      import org.bukkit.inventory.Inventory;
      import org.bukkit.inventory.ItemStack;
      import org.bukkit.plugin.java.JavaPlugin;
      
      public class Main extends JavaPlugin implements Listener {
      
          public void onEnable(){
              Bukkit.getPluginManager().registerEvents(this, this);
      
          }
      
          @EventHandler
          public void onInventoryClose(InventoryCloseEvent e) {
              Bukkit.broadcastMessage("Closed!");
              e.getPlayer().teleport(new Location(e.getPlayer().getWorld(), 0, 100, 0));
          }
          
      
          @EventHandler
          public void onBlockPlace(BlockPlaceEvent e){
      
              Inventory menu = Bukkit.createInventory(null, InventoryType.CHEST, "Title");
              for(int i = 11; i < 16; i++) {
                  menu.setItem(i, new ItemStack(Material.WOOL, 1));
              }
      
              e.getPlayer().openInventory(menu);
      
          }
      }
      

      After placing a block and closing the custom inventory, "Closed" is continously broadcasted until the server shuts itself down. While mostly silent, under some circumstances a humongous stacktrace showed up instead of a server shutdown. This error log as well as the compiled code are attached.

        1. BugTest.jar
          2 kB
        2. latest.log
          228 kB

            Unassigned Unassigned
            liec0dez liec0dez
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: