Here is my code i dont understand why when i click AIR it doesnt open the GUI Here is my code Code (Text): @EventHandler public void onInt(PlayerInteractEvent e) { if(e.getAction() == Action.RIGHT_CLICK_BLOCK || e.getAction() == Action.RIGHT_CLICK_AIR) { //new ItemStack heald = new ItemStack(Material.POTION); ItemMeta meta = heald.getItemMeta(); meta.setDisplayName(ChatColor.AQUA + "Testers"); heald.setItemMeta(meta); //new ItemStack feed = new ItemStack(Material.FEATHER); ItemMeta feedmeta = feed.getItemMeta(); feedmeta.setDisplayName(ChatColor.AQUA + "FeedMeta"); feed.setItemMeta(feedmeta); Inventory inv = Bukkit.createInventory(null, 27, ChatColor.GREEN + "Heal And Feed"); inv.setItem(2, heald); inv.setItem(6, feed); e.getPlayer().openInventory(inv);
Eh what? The Action is still applied to the right click at the air ( block ) so the items in hand are not necessary
No from what I know, let's say you have the event checking for a right click in the air it wouldn't do anything unless you an item in your hand. It works for left click air tho. As for clicking blocks the right click block check should be true and run the code
@danielm175 @Phloxz Basically the minecraft client doesn't send a player interact packet when you right-click in the air with nothing in your hand. There's unfortunately nothing you can do about it.