I've had to totally change anvils on my server due to a naming bug, so I am having to create a system which allows player's to enchant their tools without anvils. I have a system where if they right click with a piece of paper, it enchants the player's first slot with the enchantments of the paper. I want this to be done with enchanted books aswell as the paper, but it does not seem enchanted books actually have enchantments.
code_language.skript:
on right click:
player is holding paper
player's tool is enchanted
loop enchants of player's tool:
enchant slot 0 of player's inventory with "%loop-value% %level of loop-value of the tool%" parsed as enchantment type
remove 1 paper from player's tool
on right click with enchanted book:
loop enchants of player's tool:
enchant slot 0 of player's inventory with "%loop-value% %level of loop-value of the tool%" parsed as enchantment type
send "%loop-value% %level of loop-value of the tool%" to player
remove 1 enchanted book from player's tool