Hello. I want to spawn something like magic wand. So let it be a simple stick with “Magic wand” label and custom “Magic power” enchantment, that does nothing - just text.
With first I have no problem, but I’m stuck on custom enchantment creation. I found no way to show any custom text instead of exnchantment.
It possible to implement this only on server-side plugin? Or there are have another way to “sign” item?
I saw similar in “Roguelike Dungeons” forge mod - enchanted sticks and swords with… em… something like “description” below the label: “Warm to touch” for example.
p.s.
Sorry for my english
I’m not english speaking :c
Enchantment lore is automatically added to the lore of the item when it has custom enchantments on it. You can emulate the enchantment lore effect by adding regular text with TextColors.GRAY to the lore of the item. However, this can be used with any text.
So how can I add custom enchantment? In example, I implement Enchantment interface in new class, then create ItemEnchantment with this class and offer it to item stack. This item (stick) wont stack with regular sticks, but I cant see any enchantment lore on item. What I’m doing wrong?
Someone correct me if I’m wrong, but I don’t think you can implement your own enchantments. What you could do, is convince the player the item was enchanted by adding a line of lore styled exactly the same as enchantments.
You could use Keys.HIDE_ENCHANTMENTS and apply an enchantment which would not affect the item at all (eg. infinity to item which is not a bow). The disadvantage of this approach is, that it’s not easy to display the rest of the enchantments the item could have.