Clickable Custom Enchants

Discussion in 'Plugin Development' started by Jelles, Jun 28, 2019.

  1. Offline

    Jelles

    I am trying to make it so that my custom enchant like one of these:
    upload_2019-6-29_1-41-22.png

    This enchanted book can be applied to any sword when that sword is clicked with this book. So the meta displayName gets added to the swords lore. I've been struggling with this all day and I am very close now. At the moment when you click the sword the lore gets added to the sword this sword gets removed and a copy of the old sword with the right lore gets added to the players inventory. The problem is I want to make it so that the slot that is clicked, so the e.getSlot() gets this sword item. In order to do this I did this:
    upload_2019-6-29_1-45-21.png
    Sadly this does not work the book that I clicked the sword with is on this slot and stays on this slot. If I change my code to:
    upload_2019-6-29_1-45-59.png
    This does work but it's still not in the right spot I want it to be on the spot where the book is. Here is my full code for this InventoryListener:
    upload_2019-6-29_1-47-12.png

    Hopefully this is enough detail if anything is unclear please let me know I will try to explain it.
     
  2. Offline

    DerDonut

    Cancel the event
     
    Kars likes this.

Share This Page