InventoryCloseEvent fires twice when a player quits the game, once before PlayerQuitEvent and once more after PlayerQuitEvent.
This causes problems with plugins that clear up player states in PlayerQuitEvent, as the players would not be present when InventoryCloseEvent is called.
This is the plugin that was used to generate the output captured in the above screenshot:
import org.bukkit.Bukkit; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.inventory.InventoryCloseEvent; import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.plugin.java.JavaPlugin; public final class EventOrderTest extends JavaPlugin implements Listener { @Override public void onEnable() { Bukkit.getServer().getPluginManager().registerEvents(this, this); } @EventHandler public void onPlayerQuit(final PlayerQuitEvent event) { getLogger().info("PlayerQuitEvent"); } @EventHandler public void onInventoryClose(final InventoryCloseEvent event) { getLogger().info("InventoryCloseEvent"); } }