@EventHandler
    public void inventoryclick(InventoryClickEvent e){
        if (e.getInventory().getName().equalsIgnoreCase("Choose game: ")){

            if (e.getRawSlot() < 54 && e.getRawSlot() > -1){ // the top inv rawslots are numbered 0 to 53 starting top left, -999 is returned if u click outside the inv view screen
                ItemStack itemclicked = e.getCurrentItem();
                ItemStack cursor = e.getCursor();
                e.setCancelled(true);
                if (cursor.getType() == Material.AIR){ //if player has no item on the cursor
                 ItemMeta meta = itemclicked.getItemMeta();
                 String display = meta.getDisplayName();
                 if(display=="Upgrading")
                 {
                	 Player player = (Player) e.getWhoClicked();
                	upgrading.putGame(player, 1);
                    player.getServer().getWorld("world")
                    .setSpawnLocation(272, 120, 38);
            		player.setHealth(0);
                 }
                 if(display=="Creative Test World")
                 {

                	 Player player = (Player) e.getWhoClicked();
                  	upgrading.putGame(player, 2);

               	 WorldManager.sendPlayer(player,"creative",GameMode.SURVIVAL);
                 }
                 if(display=="Trench")
                 {
                	 Player player = (Player) e.getWhoClicked();
                  	upgrading.putGame(player, 3);

               	 WorldManager.sendPlayer(player,"trench",GameMode.SURVIVAL);
                 }
                 if(display=="Capture game")
                 {
                	 Player player = (Player) e.getWhoClicked();
                  	upgrading.putGame(player, 4);
                	 WorldManager.sendPlayer(player,"capture",GameMode.SURVIVAL);
                 }
                 if(display=="Parkour")
                 {
                	 Player player = (Player) e.getWhoClicked();
                  	upgrading.putGame(player, 4);
                	 WorldManager.sendPlayer(player,"parkour",GameMode.SURVIVAL);
                 }
                }
            }
        }
    }