Dec 22nd 2017 #1 Java public void PlayerInventoryToChestEvent(PlayerInventoryToChestEvent event){ Player player = event.getPlayer(); final int infoId = event.getChestID(); String Pname = player.getName(); Chest chest = getWorld().getChest(infoId); if (infoId == 2103){ String query = "SELECT * FROM Money WHERE `User` = '" + Pname + "'"; try (ResultSet result = db.executeQuery(query)){ while(result.next()) { String User= result.getString("User"); int Amount = result.getInt("Amount"); int total = Amount+10; db.executeUpdate("UPDATE `Money` SET `Amount` = '" + total + "' WHERE `User` = '" + Pname + "' "); } //p.setAttribute("TotAmount", 2000); } catch (SQLException e) { e.printStackTrace(); } chest.clear(); } player.sendTextMessage("[#ffff00] chest id: " + chest.getID()); } Display More it only works in single player, it clears the chest in singleplayer, but not on the server
Dec 22nd 2017 #2 so does it give an error on the server or just nothing happens? Could you maybe post the server log here for us to see?
Dec 22nd 2017 #3 ok thats strange, it removes things slowly, but not everything gets cleared, just random things get left in, no errors.