-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
None
-
Java 8
Windows 7
-
1.13-RO-1 snapshot
When cancelling the InventoryClickEvent then item does not return to the player inventory the problem is the inventory is not updating or not sync. with the server data. So you have to call player.updateInventory() to fixed this. This behavior was not present in the past versions.
Attached a plugin that contains this code which I used to test the issue which contains this code
package testPackage;import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.plugin.java.JavaPlugin;public class TestClass extends JavaPlugin implements Listener { @Override public void onEnable() { this.getServer().getPluginManager().registerEvents(this, this); } @EventHandler public void onInventoryClick(InventoryClickEvent event) { event.setCancelled(true); } }