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

Taking a book from a lectern should call an event

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • CraftBukkit version git-Bukkit-d203283 (MC: 1.14)
    • Yes

      When a player tries to take a book from a lectern an event should be called.

       

      I think the best matching event is the InventoryClickEvent with a new InventoryAction MOVE_TO_OTHER_INVENTORY_OR_DROP - Because unlike other inventory actions this action will drop the stack if there is no free space in the players inventory.

       

      I will create a PR for this.

       

      Attached is an example plugin that does some debug output for the InventoryClickEvent and allows to cancel it. To toggle the cancelling, execute /togglebooktake

        1. BookTakePlugin.java
          1 kB
          Brokkonaut

            Unassigned Unassigned
            Brokkonaut Brokkonaut
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: