Spigot API inventory close

Java
@EventHandler
public void onInventoryClose(InventoryCloseEvent e) {
  
}
Source

Also in Java: