Class GlowingEntities

java.lang.Object
fr.skytasul.glowingentities.GlowingEntities
All Implemented Interfaces:
org.bukkit.event.Listener

public class GlowingEntities extends Object implements org.bukkit.event.Listener
An util to easily make entities glow.
Author:
SkytAsul
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
    Uniquely represents an entity (e.g.
    static final record 
     
    static final record 
     
    protected static class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final @NotNull org.bukkit.plugin.Plugin
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    GlowingEntities(@NotNull org.bukkit.plugin.Plugin plugin)
    Initializes the Glowing API.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Disables the API.
    void
    Enables the Glowing API.
    void
    onQuit(org.bukkit.event.player.PlayerQuitEvent event)
     
    void
    setGlowing(@NotNull GlowingEntities.EntityIdentifier entity, @NotNull String teamID, @NotNull org.bukkit.entity.Player receiver, @Nullable org.bukkit.ChatColor color, byte otherFlags)
    Make an entity glow with the specified color, and keep some flags.
    void
    setGlowing(@NotNull org.bukkit.entity.Entity entity, @NotNull org.bukkit.entity.Player receiver)
    Make the Entity passed as a parameter glow with its default team color.
    void
    setGlowing(@NotNull org.bukkit.entity.Entity entity, @NotNull org.bukkit.entity.Player receiver, @Nullable org.bukkit.ChatColor color)
    Make the Entity passed as a parameter glow with the specified color.
    void
    unsetGlowing(@NotNull GlowingEntities.EntityIdentifier entity, @NotNull org.bukkit.entity.Player receiver)
    Make an entity loose its previously existing glowing effect.
    void
    unsetGlowing(@NotNull org.bukkit.entity.Entity entity, @NotNull org.bukkit.entity.Player receiver)
    Make the Entity passed as a parameter loose its custom glowing effect.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • plugin

      @NotNull protected final @NotNull org.bukkit.plugin.Plugin plugin
  • Constructor Details

    • GlowingEntities

      public GlowingEntities(@NotNull @NotNull org.bukkit.plugin.Plugin plugin)
      Initializes the Glowing API.
      Parameters:
      plugin - plugin that will be used to register the events.
  • Method Details

    • enable

      public void enable()
      Enables the Glowing API.
      See Also:
    • disable

      public void disable()
      Disables the API.

      Methods to change the glowing statuses will no longer be usable.

      See Also:
    • onQuit

      public void onQuit(org.bukkit.event.player.PlayerQuitEvent event)
    • setGlowing

      public void setGlowing(@NotNull @NotNull org.bukkit.entity.Entity entity, @NotNull @NotNull org.bukkit.entity.Player receiver) throws ReflectiveOperationException
      Make the Entity passed as a parameter glow with its default team color.
      Parameters:
      entity - entity to make glow
      receiver - player which will see the entity glowing
      Throws:
      ReflectiveOperationException
    • setGlowing

      public void setGlowing(@NotNull @NotNull org.bukkit.entity.Entity entity, @NotNull @NotNull org.bukkit.entity.Player receiver, @Nullable @Nullable org.bukkit.ChatColor color) throws ReflectiveOperationException
      Make the Entity passed as a parameter glow with the specified color.
      Parameters:
      entity - entity to make glow
      receiver - player which will see the entity glowing
      color - color of the glowing effect
      Throws:
      ReflectiveOperationException
    • setGlowing

      public void setGlowing(@NotNull @NotNull GlowingEntities.EntityIdentifier entity, @NotNull @NotNull String teamID, @NotNull @NotNull org.bukkit.entity.Player receiver, @Nullable @Nullable org.bukkit.ChatColor color, byte otherFlags) throws ReflectiveOperationException
      Make an entity glow with the specified color, and keep some flags.
      Parameters:
      entity - identifier of the entity to make glow
      teamID - internal string used to add the entity to a team
      receiver - player which will see the entity glowing
      color - color of the glowing effect or null if it should glow the color of its team (or white if none)
      otherFlags - internal flags that must be kept (on fire, crouching...). See wiki.vg for more informations.
      Throws:
      ReflectiveOperationException
    • unsetGlowing

      public void unsetGlowing(@NotNull @NotNull org.bukkit.entity.Entity entity, @NotNull @NotNull org.bukkit.entity.Player receiver) throws ReflectiveOperationException
      Make the Entity passed as a parameter loose its custom glowing effect.

      This has no effect on glowing status given by another plugin or vanilla behavior.

      Parameters:
      entity - entity to remove glowing effect from
      receiver - player which will no longer see the glowing effect
      Throws:
      ReflectiveOperationException
    • unsetGlowing

      public void unsetGlowing(@NotNull @NotNull GlowingEntities.EntityIdentifier entity, @NotNull @NotNull org.bukkit.entity.Player receiver) throws ReflectiveOperationException
      Make an entity loose its previously existing glowing effect.

      This has no effect on glowing status given by another plugin or vanilla behavior.

      Parameters:
      entity - identifier of the entity to remove glowing effect from
      receiver - player which will no longer see the glowing effect
      Throws:
      ReflectiveOperationException