Class ColoredGlowLibAPI

java.lang.Object
me.emafire003.dev.coloredglowlib.ColoredGlowLibAPI

public class ColoredGlowLibAPI extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    ColoredGlowLibAPI(net.minecraft.scoreboard.Scoreboard scoreboard)
    Create an instance of the ColoredGlowLib API
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    clearColor(net.minecraft.entity.Entity entity, boolean useDefaultColorInstead)
    Removes the custom color from an entity.
    void
    clearColor(net.minecraft.entity.EntityType<?> entityType, boolean useDefaultColorInstead)
    Removes the custom color from an EntityType.
    void
    clearExclusiveColorFor(net.minecraft.entity.Entity entity, net.minecraft.entity.player.PlayerEntity colorViewer, boolean useDefaultColorInstead)
    Removes the custom color from an entity visible to a certain player.
    void
    Resets the global default color to #ffffff, which is the default color used by vanilla Minecraft.
    getColor(net.minecraft.entity.Entity target)
    Gets the custom glow color of an Entity.
    getColor(net.minecraft.entity.EntityType<?> target)
    Gets the custom glow color of an EntityType.
    An alias of getGlobalColor()
    boolean
    Gets the current override status of Default color over others
    boolean
    Gets the current override status of EntityType color over Entity Color
    getExclusiveColorFor(net.minecraft.entity.Entity target, net.minecraft.entity.player.PlayerEntity colorViewer)
    Gets the custom glow color of an Entity that only the specified player sees.
    Gets the global/default custom glow color
    boolean
    Gets the overrideTeamColors option.
    boolean
    hasCustomColor(net.minecraft.entity.Entity target)
    Checks if an Entity has a custom glow color or not.
    boolean
    hasCustomColor(net.minecraft.entity.EntityType<?> target)
    Checks if an EntityType has a custom glow color or not.
    boolean
    hasCustomColorAnimation(net.minecraft.entity.Entity target)
    Checks is the custom color of EntityType is a custom animation added through a datapack
    boolean
    hasCustomColorAnimation(net.minecraft.entity.EntityType<?> target)
    Checks is the custom color of EntityType is a custom animation added through a datapack
    boolean
    hasCustomOrDefaultColor(net.minecraft.entity.Entity target)
    Checks if an Entity has a custom glow color or not.
    boolean
    hasCustomOrDefaultColor(net.minecraft.entity.EntityType<?> target)
    Checks if an EntityType has a custom glow color or not.
    boolean
    hasExclusiveCustomColorFor(net.minecraft.entity.Entity target, net.minecraft.entity.player.PlayerEntity colorViewer)
    Checks if an Entity has a custom glow color visible only to another player or not.
    boolean
    hasExclusiveCustomOrDefaultColorFor(net.minecraft.entity.Entity target, net.minecraft.entity.player.PlayerEntity colorViewer)
    Checks if an Entity has a custom glow color visible only to the specified player or not.
    boolean
    hasRainbowColor(net.minecraft.entity.Entity target)
    Checks is the custom color of Entity is rainbow
    boolean
    hasRainbowColor(net.minecraft.entity.EntityType<?> target)
    Checks is the custom color of EntityType is rainbow
    boolean
    hasRandomColor(net.minecraft.entity.Entity target)
    Checks is the custom color of Entity is random
    boolean
    hasRandomColor(net.minecraft.entity.EntityType<?> target)
    Checks is the custom color of EntityType is random
    void
    setColor(net.minecraft.entity.Entity target, String color)
    Sets a custom glow color for an Entity.
    void
    setColor(net.minecraft.entity.EntityType<?> target, String color)
    Sets a custom glow color for an EntityType.
    void
    void
    Makes the Default color override a potential Entity-specific or EntityType-specific color.
    void
    Makes the EntityType-specific color override a potential Entity-specific color.
    void
    setExclusiveColorFor(net.minecraft.entity.Entity target, String color, net.minecraft.entity.player.PlayerEntity colorViewer)
    Sets a custom glow color for an Entity, visible only to another player.
    void
    Sets a default global color.
    void
    Makes the default color to be "rainbow", so every entity will by default glow in rainbow colors, kinda like a _jeb sheep.
    void
    Makes the default color to be "random", so every entity will by default glow in a random color each tick.
    void
    Set this to true to override the default minecraft team colors even of the entity is in a team.
    void
    setRainbowColor(net.minecraft.entity.Entity target)
    Sets the custom glow color of an Entity to rainbow.
    void
    setRainbowColor(net.minecraft.entity.EntityType<?> target)
    Sets the custom glow color of an EntityType to rainbow.
    void
    setRandomColor(net.minecraft.entity.Entity target)
    Sets the custom glow color of an Entity to a random, the entity will glow a different color each tick.
    void
    setRandomColor(net.minecraft.entity.EntityType<?> target)
    Sets the custom glow color of an Entity to a random, the entity will glow a different color each tick.

    Methods inherited from class java.lang.Object

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

    • ColoredGlowLibAPI

      public ColoredGlowLibAPI(net.minecraft.scoreboard.Scoreboard scoreboard)
      Create an instance of the ColoredGlowLib API
      Parameters:
      scoreboard - An instance of the server/worlds scoreboard that will be used to get server-wide settings such as defaultColor the EntityType's colors and so on
  • Method Details

    • setOverrideTeamColors

      public void setOverrideTeamColors(boolean b)
      Set this to true to override the default minecraft team colors even of the entity is in a team.

      By default this option is set to false

      Parameters:
      b - The value to assing to overrideTeamColors
    • getOverrideTeamColors

      public boolean getOverrideTeamColors()
      Gets the overrideTeamColors option.
      Returns:
      Returns true if the default minecraft team colors are being overridden by the mod's ones.
    • setDefaultOverridesAll

      public void setDefaultOverridesAll(boolean b)
      Makes the Default color override a potential Entity-specific or EntityType-specific color.

      By default this option is false

      Parameters:
      b - Set to true to enable overriding, set false to disable it.
    • getDefaultOverridesAll

      public boolean getDefaultOverridesAll()
      Gets the current override status of Default color over others
      Returns:
      Returns true if the Default color overrides the Entity/EntityType-specific one
    • setEntityTypeColorOverridesEntityColor

      public void setEntityTypeColorOverridesEntityColor(boolean b)
      Makes the EntityType-specific color override a potential Entity-specific color.

      By default this option is false

      Parameters:
      b - Set to true to enable overriding, set false to disable it.
    • getEntityTypeColorOverridesEntityColor

      public boolean getEntityTypeColorOverridesEntityColor()
      Gets the current override status of EntityType color over Entity Color
      Returns:
      Returns true if the EntityType-specific color overrides the Entity-specific one
    • setGlobalColor

      public void setGlobalColor(String color)
      Sets a default global color. The one used by default is "#ffffff, same as vanilla Minecraft.

      If an entity has another color assigned to its EntityType, or itself it will glow that color instead of this one, unless setDefaultOverridesAll(boolean) method is used.

      Parameters:
      color - An hexadecimal color value String, like "#RRGGBB", or "rainbow" to make the rainbow color, or "random" to make a random color each tick. It can also be a custom color animation name added by a datapack
    • setGlobalRainbow

      public void setGlobalRainbow()
      Makes the default color to be "rainbow", so every entity will by default glow in rainbow colors, kinda like a _jeb sheep.

      If an entity has another color assigned to its EntityType, or itself it will glow that color instead of this one, unless setDefaultOverridesAll(boolean) method is used.

    • setGlobalRandom

      public void setGlobalRandom()
      Makes the default color to be "random", so every entity will by default glow in a random color each tick.

      If an entity has another color assigned to its EntityType, or itself it will glow that color instead of this one, unless setDefaultOverridesAll(boolean) method is used.

    • setDefaultColor

      public void setDefaultColor(String color)
    • clearGlobalColor

      public void clearGlobalColor()
      Resets the global default color to #ffffff, which is the default color used by vanilla Minecraft.
    • setColor

      public void setColor(net.minecraft.entity.Entity target, String color)
      Sets a custom glow color for an Entity. The entity will now glow the specified color instead of vanilla minecraft's one.

      This glow color can be overridden by other methods, such as: setDefaultOverridesAll(boolean) and setEntityTypeColorOverridesEntityColor(boolean) If no color is specified, but an EntityType or default color is, the entity will glow that color.

      Parameters:
      target - The Entity that will glow the specified color
      color - An hexadecimal color value String, like "#RRGGBB", or "rainbow" to make the rainbow color, or "random" to make a random color each tick. It can also be a custom color animation name added by a datapack
    • setColor

      public void setColor(net.minecraft.entity.EntityType<?> target, String color)
      Sets a custom glow color for an EntityType. All entities of the specified EntityType will now glow the specified color instead of vanilla minecraft's one.

      This glow color can be overridden by other methods, such as: setDefaultOverridesAll(boolean) If an Entity has a color which is different from its EntityType's one it will glow that color unless setEntityTypeColorOverridesEntityColor(boolean) is enabled

      If no color is specified, but a default color is, the entities will glow that color.

      Parameters:
      target - The EntityType that will glow the specified color
      color - An hexadecimal color value String, like "#RRGGBB", or "rainbow" to make the rainbow color, or "random" to make a random color each tick. It can also be a custom color animation name added by a datapack
    • setRainbowColor

      public void setRainbowColor(net.minecraft.entity.Entity target)
      Sets the custom glow color of an Entity to rainbow. This will make the entity glow every color periodically like a _jeb sheep

      See setColor(Entity, String) for more information

      Parameters:
      target - The Entity that will glow the specified color
    • setRandomColor

      public void setRandomColor(net.minecraft.entity.Entity target)
      Sets the custom glow color of an Entity to a random, the entity will glow a different color each tick.

      See setColor(Entity, String) for more information

      Parameters:
      target - The Entity that will glow the specified color
    • setRainbowColor

      public void setRainbowColor(net.minecraft.entity.EntityType<?> target)
      Sets the custom glow color of an EntityType to rainbow. This will make the entities of that type glow every color periodically like a _jeb sheep

      See setColor(EntityType, String) for more information

      Parameters:
      target - The EntityType that will glow the specified color
    • setRandomColor

      public void setRandomColor(net.minecraft.entity.EntityType<?> target)
      Sets the custom glow color of an Entity to a random, the entity will glow a different color each tick.

      See setColor(EntityType, String) for more information

      Parameters:
      target - The EntityType that will glow the specified color
    • clearColor

      public void clearColor(net.minecraft.entity.Entity entity, boolean useDefaultColorInstead)
      Removes the custom color from an entity. It will be set back to "#fffff", unless useDefaultColorInstead is true, in which case the default color you specified will be used. The default color is the same one that would be applied globally if setDefaultOverridesAll(boolean) is used
      Parameters:
      entity - The entity that will be cleared from the color
      useDefaultColorInstead - Weather or not to use the default color or #ffffff
    • clearColor

      public void clearColor(net.minecraft.entity.EntityType<?> entityType, boolean useDefaultColorInstead)
      Removes the custom color from an EntityType. It will be set back to "#fffff", unless useDefaultColorInstead is true, in which case the default color you specified will be used. The default color is the same one that would be applied globally if setDefaultOverridesAll(boolean) is used.

      This will also clear the rainbow/random/custom color!

      Parameters:
      entityType - The EntityType that will be cleared from the color
      useDefaultColorInstead - Weather or not to use the default color or #ffffff
    • getColor

      public String getColor(net.minecraft.entity.Entity target)
      Gets the custom glow color of an Entity.

      The result could be "#ffffff" meaning it does not have a custom color and is using the vanilla one, or "rainbow" meaning its glowing rainbow, or "random" meaning its glowing a random color each tick, or another hexadecimal string color.

      It can also return a custom animation name if they are added by a datapack

      If you need a color value instead you can use ColorUtils to manipulate it

      Parameters:
      target - The Entity to check the color for
      Returns:
      The color string associated to that entity
    • getColor

      public String getColor(net.minecraft.entity.EntityType<?> target)
      Gets the custom glow color of an EntityType.

      The result could be "#ffffff" meaning it does not have a custom color and is using the vanilla one, or "rainbow" meaning its glowing rainbow, or "random" meaning its glowing a random color each tick, or another hexadecimal string color.

      It can also return a custom animation name if they are added by a datapack

      If you need a color value instead you can use ColorUtils to manipulate it

      Parameters:
      target - The EntityType to check the color for
      Returns:
      The color string associated to that EntityType
    • getGlobalColor

      public String getGlobalColor()
      Gets the global/default custom glow color

      The result could be "#ffffff" meaning it does not have a custom color and is using the vanilla one, or "rainbow" meaning its glowing rainbow, or "random" meaning its glowing a random color each tick, or another hexadecimal string color.

      It can also return a custom animation name if they are added by a datapack

      If you need a color value instead you can use ColorUtils to manipulate it

      Returns:
      The color string associated to the global color
    • getDefaultColor

      public String getDefaultColor()
      An alias of getGlobalColor()
      Returns:
      The color string associated to the global color
    • hasCustomColor

      public boolean hasCustomColor(net.minecraft.entity.EntityType<?> target)
      Checks if an EntityType has a custom glow color or not. This is done by checking if its color (stored in the global component) is "#ffffff" or not.

      WARNING! This doesn't mean necessarily mean it has a custom color added by a datapack but that it has a color that is different from the default value of white!

      Warning! If you used clearColor(EntityType, boolean) with useDefaultColorInstead to true, you may want to use: hasCustomOrDefaultColor(EntityType)

      Parameters:
      target - The EntityType to check the color for
      Returns:
      Returns true if the EntityType has a custom glow color associated to it.
    • hasCustomOrDefaultColor

      public boolean hasCustomOrDefaultColor(net.minecraft.entity.EntityType<?> target)
      Checks if an EntityType has a custom glow color or not. This is done by checking if its color is "#ffffff" or if it's the defaultColor specified using setDefaultColor(String) WARNING! This doesn't mean necessarily mean it has a custom color added by a datapack but that it has a color that is different from the default value of white!
      Parameters:
      target - The EntityType to check the color for
      Returns:
      Returns true if the EntityType has a custom glow color associated to it that differs from the defaultColor.
    • hasCustomColor

      public boolean hasCustomColor(net.minecraft.entity.Entity target)
      Checks if an Entity has a custom glow color or not. This is done by checking if its color (stored in the component) is "#ffffff" or not.

      WARNING! This doesn't mean necessarily mean it has a custom color added by a datapack but that it has a color that is different from the default value of white!

      Warning! If you used clearColor(Entity, boolean) with useDefaultColorInstead to true, you may want to use: hasCustomOrDefaultColor(Entity)

      Parameters:
      target - The Entity to check the color for
      Returns:
      Returns true if the Entity has a custom glow color associated to it.
    • hasCustomOrDefaultColor

      public boolean hasCustomOrDefaultColor(net.minecraft.entity.Entity target)
      Checks if an Entity has a custom glow color or not. This is done by checking if its color is "#ffffff" or if it's the defaultColor specified using setDefaultColor(String) WARNING! This doesn't mean necessarily mean it has a custom color added by a datapack but that it has a color that is different from the default value of white!
      Parameters:
      target - The Entity to check the color for
      Returns:
      Returns true if the Entity has a custom glow color associated to it that differs from the defaultColor.
    • hasRainbowColor

      public boolean hasRainbowColor(net.minecraft.entity.EntityType<?> target)
      Checks is the custom color of EntityType is rainbow
      Parameters:
      target - The EntityType to check the rainbow color for
      Returns:
      Returns true if the color associated to that EntityType is rainbow
    • hasRandomColor

      public boolean hasRandomColor(net.minecraft.entity.EntityType<?> target)
      Checks is the custom color of EntityType is random
      Parameters:
      target - The EntityType to check the random color for
      Returns:
      Returns true if the color associated to that EntityType is random
    • hasRainbowColor

      public boolean hasRainbowColor(net.minecraft.entity.Entity target)
      Checks is the custom color of Entity is rainbow
      Parameters:
      target - The Entity to check the rainbow color for
      Returns:
      Returns true if the color associated to that Entity is rainbow
    • hasRandomColor

      public boolean hasRandomColor(net.minecraft.entity.Entity target)
      Checks is the custom color of Entity is random
      Parameters:
      target - The Entity to check the random color for
      Returns:
      Returns true if the color associated to that Entity is random
    • hasCustomColorAnimation

      public boolean hasCustomColorAnimation(net.minecraft.entity.EntityType<?> target)
      Checks is the custom color of EntityType is a custom animation added through a datapack
      Parameters:
      target - The EntityType to check the rainbow color for
      Returns:
      Returns true if the color associated to that EntityType is added by a datapack
    • hasCustomColorAnimation

      public boolean hasCustomColorAnimation(net.minecraft.entity.Entity target)
      Checks is the custom color of EntityType is a custom animation added through a datapack
      Parameters:
      target - The Entity to check the random color for
      Returns:
      Returns true if the color associated to that Entity is added by a datapack
    • setExclusiveColorFor

      public void setExclusiveColorFor(net.minecraft.entity.Entity target, String color, net.minecraft.entity.player.PlayerEntity colorViewer)
      Sets a custom glow color for an Entity, visible only to another player. The entity will now glow the specified color instead of vanilla minecraft's one.

      This glow color can be overridden by other methods, such as: setDefaultOverridesAll(boolean) and setEntityTypeColorOverridesEntityColor(boolean) If no color is specified, but an EntityType or default color is, the entity will glow that color.

      Parameters:
      target - The Entity that will glow the specified color
      color - An hexadecimal color value String, like "#RRGGBB", or "rainbow" to make the rainbow color, or "random" to make a random color each tick. It can also be a custom color animation name added by a datapack
      colorViewer - The only Player who will see the specified color
    • clearExclusiveColorFor

      public void clearExclusiveColorFor(net.minecraft.entity.Entity entity, net.minecraft.entity.player.PlayerEntity colorViewer, boolean useDefaultColorInstead)
      Removes the custom color from an entity visible to a certain player. It will be set back to "#fffff", unless useDefaultColorInstead is true, in which case the default color you specified will be used. The default color is the same one that would be applied globally if setDefaultOverridesAll(boolean) is used

      IT WILL ONLY CLEAR THE COLOR SET BY setExclusiveColorFor(Entity, String, PlayerEntity)

      Parameters:
      entity - The entity that will be cleared from the color
      colorViewer - The player that is currently seeing the custom exclusive color
      useDefaultColorInstead - Weather or not to use the default color or #ffffff
    • getExclusiveColorFor

      public String getExclusiveColorFor(net.minecraft.entity.Entity target, net.minecraft.entity.player.PlayerEntity colorViewer)
      Gets the custom glow color of an Entity that only the specified player sees.

      The result could be "#ffffff" meaning it does not have a custom color and is using the vanilla one, or "rainbow" meaning its glowing rainbow, or "random" meaning its glowing a random color each tick, or another hexadecimal string color.

      It can also return a custom animation name if they are added by a datapack

      If you need a color value instead you can use ColorUtils to manipulate it

      Parameters:
      target - The Entity to check the color for
      colorViewer - The player that is viewing the custom exclusive color
      Returns:
      The color string associated to that entity
    • hasExclusiveCustomColorFor

      public boolean hasExclusiveCustomColorFor(net.minecraft.entity.Entity target, net.minecraft.entity.player.PlayerEntity colorViewer)
      Checks if an Entity has a custom glow color visible only to another player or not.

      WARNING! This doesn't mean necessarily mean it has a custom color added by a datapack but that it has a color that is different from the default value of white!

      Warning! If you used clearColor(EntityType, boolean) with useDefaultColorInstead to true, you may want to use: hasExclusiveCustomOrDefaultColorFor(Entity, PlayerEntity)

      Parameters:
      target - The EntityType to check the color for
      colorViewer - The player that could be seeing the custom exclusive color
      Returns:
      Returns true if the Entity has a custom glow color associated to the player.
    • hasExclusiveCustomOrDefaultColorFor

      public boolean hasExclusiveCustomOrDefaultColorFor(net.minecraft.entity.Entity target, net.minecraft.entity.player.PlayerEntity colorViewer)
      Checks if an Entity has a custom glow color visible only to the specified player or not.

      WARNING! This doesn't mean necessarily mean it has a custom color added by a datapack but that it has a color that is different from the default value of white!

      Parameters:
      target - The Entity to check the color for
      colorViewer - The player that could be seeing the custom exclusive color
      Returns:
      Returns true if the Entity has a custom glow color associated to it that differs from the defaultColor.