Solved How can i add a Custom Enchantment?

_Iuri

New member
Jan 16, 2022
22
3
3
Well... that, i wanna add a custom enchant to my server... i tried:

Code:
Enchantment.registerEnchantment();

But this doesn't works. So... which is the correct way to implement my own Enchantments?
 

Machine Maker

Paper Developer
Staff member
Dec 17, 2021
132
6
19
18
California
Adding custom enchantments isn't supported by the API. You have to use reflection to allow the registering of new Enchantments (see what the registerEnchantment method does and checks to see if its valid).

For some things, you have to use nms (or reflection) to add an enchantment to the NMS registery for enchantments.
 

Sheepion

New member
Feb 27, 2022
9
1
3
China