Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-6038

PlayerInteractEvent - right click book on lectern

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Minor Minor
    • None
    • None
    • Windows 10
      Java 8
      Intellij Idea debugging in a terminal window.

    • CraftBukkit version git-Spigot-9639cf7-8fb6585 (MC: 1.16.1) (Implementing API version 1.16.1-R0.1-SNAPSHOT)
    • Prism-Bukkit
    • Yes

      When you right click a lectern with a book the resulting event contains
      the player and the item.
      Both the event.getItem() and the player.getInv.getIteminMainHand return an interesting item
      the handle is clearly correct -CraftItem - in the test case a book
      however the item.getType = AIR and the amount = 0

      I have attached a snippet from a debug session the code used to retrieve the data is

          @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
          private void playerInteractEventMonitor(PlayerInteractEvent event) {
      
              final Player player = event.getPlayer();
              Block block = event.getClickedBlock();
              ItemStack hand = player.getInventory().getItemInMainHand();
              ItemStack item = event.getItem();
      
      

      This was replicated while testing an implementation of my logging plugin Prism-Bukkit,
      It was the only plugin installed.

            Unassigned Unassigned
            Narimm Narimm
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: