An util to easily set glowing entities (or blocks) per-player on a Spigot server.
No ProtocolLib, no dependency, compatible from Minecraft 1.17 to 1.20.6!
Copy the GlowingEntities.java class to your project (and the GlowingBlocks.java class if required).
Add this requirement to your maven pom.xml
file:
<dependency>
<groupId>io.github.skytasul</groupId>
<artifactId>glowingentities</artifactId>
<version>{VERSION}</version>
<scope>compile</scope>
</dependency>
Additionnally, you can use the maven shade plugin to relocate the classes location.
-
Initialize the
GlowingEntities
object somewhere where you can easily get it, usingnew GlowingEntities(plugin)
. It is not recommended to create multipleGlowingEntities
instances! -
Use
GlowingEntities#setGlowing(Entity entity, Player receiver, ChatColor color)
to make an entity glow a color for a player! -
You can change its glowing color by reusing the same method but changing the
color
parameter. -
If you no longer wants your entity to glow, use
GlowingEntities#unsetGlowing(Entity entity, Player receiver)
. -
When you are completely done with the glowing API (for instance, when your plugin is shutting down), remember to use
GlowingEntities#disable()
.
The same as before but with the GlowingBlocks
class :)
Warning The
GlowingBlocks
util can only be used on Paper-based servers, not Bukkit or Spigot ones!