SpilledBukkit
Giving enchantment glow without attaching a name to it? - Printable Version

+- SpilledBukkit (https://spilledbukkit.info)
+-- Forum: Bukkit Development (https://spilledbukkit.info/forumdisplay.php?fid=4)
+--- Forum: Plugin Development (https://spilledbukkit.info/forumdisplay.php?fid=9)
+--- Thread: Giving enchantment glow without attaching a name to it? (/showthread.php?tid=12)



Giving enchantment glow without attaching a name to it? - Techno_Wizard_ - 03-25-2017

I Googled around Bukkit and Spigot with no luck with this. It seems that something within the API must have changed at some point.

How can you add an enchantment glow to an itemstack without explicitly giving it an enchantment type? What I mean is I know it can be done using an NBT tag, but that's reflection and I'm trying to avoid that if possible. Another way i've seen is creating a new enchantment implementing the bukkit enchantment interface and then attaching it to the item, but that doesn't seem to do anything.

Any ideas?


RE: Giving enchantment glow without attaching a name to it? - xTrollxDudex - 03-25-2017

Have you debugged the Bukkit enchantment/wiresharked it to ensure that the correct slot data is being sent?


RE: Giving enchantment glow without attaching a name to it? - yPedx - 04-16-2017

This should help you a bit ;D
https://bukkit.org/threads/how-to-make-an-item-glow-with-no-enchant.374594/


RE: Giving enchantment glow without attaching a name to it? - Binner_Done - 04-21-2017

(04-16-2017, 09:55 PM)yPedx Wrote:  This should help you a bit ;D
https://bukkit.org/threads/how-to-make-an-item-glow-with-no-enchant.374594/
Probably won't work. Seems a bit outdated Wink


RE: Giving enchantment glow without attaching a name to it? - MCMastery - 04-24-2017

(04-21-2017, 10:25 AM)Binner_Done Wrote:  
(04-16-2017, 09:55 PM)yPedx Wrote:  This should help you a bit ;D
https://bukkit.org/threads/how-to-make-an-item-glow-with-no-enchant.374594/
Probably won't work. Seems a bit outdated Wink

Custom enchantments work for my plugin (1.11.2), maybe you forgot to register the enchantment?
This does not require reflection:
Code:
       Enchantment.registerEnchantment(glow);



RE: Giving enchantment glow without attaching a name to it? - Techno_Wizard_ - 04-30-2017

@MCMastery that does not work. It's exactly what I'm using with no effect.


RE: Giving enchantment glow without attaching a name to it? - ArsenArsen - 05-03-2017

I've used the method above successfully in (now deprecated and abandoned) ALib. I look back with horror at the source code, but it worked. Atleast it did about a year ago. https://github.com/ArsenArsen/ALib/blob/master/src/main/java/com/arsenarsen/alib/api/utils/Item/Glow.java


RE: Giving enchantment glow without attaching a name to it? - Techno_Wizard_ - 05-04-2017

@ArsenArsen Odd. Well, when my finals end next week, I'll get a lot of time to dive back into this project and i'll give it a shot again with wireshark