Discussion in 'Plugin Requests' started by madtomic, Mar 19, 2020.

Thread Status:
Not open for further replies.
  1. Offline


    Plugin category: Mechanical

    Minecraft version: 1.12.2

    Suggested name:

    What I want: I would like a plugin that would make sure that no two different types of enchantment is able to be combine into the same enchanted book.


    Enchanted book with Protection I, cannot be combine with Enchanted Book that has Sharpness I

    This is same the other way around. Similar enchanting checking system when an piece of armor, tool or weapon is put into anvil or enchantment table.

    It will detect which is type of enchantment in the enchanted book is applicable for that item.

    Commands: No commands

    No permissions

    Thank you for reading.
    Last edited: Mar 20, 2020
  2. Offline


  3. Offline


    So, anyone interested? :)
  4. Offline


  5. Offline


    It wasn't there when I send the message. I think, the page is not refreshed.

    Thank you for trying to do this.

    The anvil mechanics will explain better.

    If the target does not have the enchantment, it gains all levels of that enchantment, unless it already has an incompatible enchantment. Enchantments are incompatible if both are in one of the following groups:
        Sword: Sharpness, Smite, and Bane of Arthropods
        Tool: Fortune and Silk Touch (as of Java version 1.12.2 you can combine these; the sacrifice item's enchantment is lost)
        Armor: Protection, Fire Protection, Blast Protection, Projectile Protection
        Boots: Depth Strider and Frost Walker
        Bow: Infinity and Mending
        Crossbow: Multishot and Piercing
    Don't worry about Crossbow as 1.12.2 don't have this.

    Using this as a guide, Enchanted Book with Knockback and Looting should combine as both enchantment are applicable on a sword.

    But if trying to combine with Infinity with either Knockback or Looting. They aren't compatible as one enchantment will not be added based on which type of item is used to add the enchantment to.

    For example, if adding Knockable + Infinity to a bow. Only Bow would get the Infinity but if adding to a Sword, it would only get the Knockable as Infinity is not applicable to Swords.

    I hope you understand what I need. I think the only way to detect this is to use Itemstack item1 and treated as if it is the Primary or Secondary Item and use that to check to see if the Itemstack item2 enchantment is compatible with the item1.

    The request is to not allow players make enchanted book that don't make sense if you were to add all the enchantments on an item.

    To sums it all up. Different group of enchantments should not be on the same enchanted book.
    Last edited: Mar 21, 2020
  6. Offline


  7. Offline



    Excellent, this is working as intended.

    Could you use anvil result event to cancel the bad combines so it may improve this feature a bit more than having to click on and get the error message. I think, simply null the anvil result would greatly improve this and thus remove the need of the error message.
  8. Offline


    I made this last modification: but there is a visual bug where the result item is set to air only when you click on it so I recommend using the release with the error message. The source code is available on Github along with all the releases so feel free to edit the code and recompile it if something is not to your liking.
  9. Offline



    Thank you so much for all your help! As for refreshing the anvil result item.

    I was gonna suggest perhaps using getScheduler().runTask() using InventoryClickEvent() to start the task.

    Anyway, I understand if you don't want to make any more modifications but thank you for all your effort.

    EDIT: There is the bug issue with enchantment exp used up when InventoryClickEvent is executed when the group aren't compatible. Refunding this exp used up would be nice.

    Last edited: Mar 22, 2020
  10. Offline


    Anyone can finish the work on this by adding the fix to refund the exp used when an incompatible repair is executed?

    The author had released the source here:

    Add config.yml
    refundExp: true/false
    errorMSG: "&cSome of your enchantments are not compatible with each other, experiences used are refunded."

  11. Offline


    Anyone can help me out with this final changes? Thanks
Thread Status:
Not open for further replies.

Share This Page