Class ColoredGlowLibAPI
-
Constructor Summary
ConstructorsConstructorDescriptionColoredGlowLibAPI(net.minecraft.scoreboard.Scoreboard scoreboard) Create an instance of the ColoredGlowLib API -
Method Summary
Modifier and TypeMethodDescriptionvoidclearColor(net.minecraft.entity.Entity entity, boolean useDefaultColorInstead) Removes the custom color from an entity.voidclearColor(net.minecraft.entity.EntityType<?> entityType, boolean useDefaultColorInstead) Removes the custom color from an EntityType.voidclearExclusiveColorFor(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.voidResets 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 ofgetGlobalColor()booleanGets the current override status of Default color over othersbooleanGets the current override status of EntityType color over Entity ColorgetExclusiveColorFor(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 colorbooleanGets the overrideTeamColors option.booleanhasCustomColor(net.minecraft.entity.Entity target) Checks if an Entity has a custom glow color or not.booleanhasCustomColor(net.minecraft.entity.EntityType<?> target) Checks if an EntityType has a custom glow color or not.booleanhasCustomColorAnimation(net.minecraft.entity.Entity target) Checks is the custom color of EntityType is a custom animation added through a datapackbooleanhasCustomColorAnimation(net.minecraft.entity.EntityType<?> target) Checks is the custom color of EntityType is a custom animation added through a datapackbooleanhasCustomOrDefaultColor(net.minecraft.entity.Entity target) Checks if an Entity has a custom glow color or not.booleanhasCustomOrDefaultColor(net.minecraft.entity.EntityType<?> target) Checks if an EntityType has a custom glow color or not.booleanhasExclusiveCustomColorFor(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.booleanhasExclusiveCustomOrDefaultColorFor(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.booleanhasRainbowColor(net.minecraft.entity.Entity target) Checks is the custom color of Entity is rainbowbooleanhasRainbowColor(net.minecraft.entity.EntityType<?> target) Checks is the custom color of EntityType is rainbowbooleanhasRandomColor(net.minecraft.entity.Entity target) Checks is the custom color of Entity is randombooleanhasRandomColor(net.minecraft.entity.EntityType<?> target) Checks is the custom color of EntityType is randomvoidSets a custom glow color for an Entity.voidSets a custom glow color for an EntityType.voidsetDefaultColor(String color) An alias ofsetGlobalColor(String)voidsetDefaultOverridesAll(boolean b) Makes the Default color override a potential Entity-specific or EntityType-specific color.voidsetEntityTypeColorOverridesEntityColor(boolean b) Makes the EntityType-specific color override a potential Entity-specific color.voidsetExclusiveColorFor(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.voidsetGlobalColor(String color) Sets a default global color.voidMakes the default color to be "rainbow", so every entity will by default glow in rainbow colors, kinda like a _jeb sheep.voidMakes the default color to be "random", so every entity will by default glow in a random color each tick.voidsetOverrideTeamColors(boolean b) Set this to true to override the default minecraft team colors even of the entity is in a team.voidsetRainbowColor(net.minecraft.entity.Entity target) Sets the custom glow color of an Entity to rainbow.voidsetRainbowColor(net.minecraft.entity.EntityType<?> target) Sets the custom glow color of an EntityType to rainbow.voidsetRandomColor(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.voidsetRandomColor(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.
-
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
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
An alias ofsetGlobalColor(String) -
clearGlobalColor
public void clearGlobalColor()Resets the global default color to #ffffff, which is the default color used by vanilla Minecraft. -
setColor
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)andsetEntityTypeColorOverridesEntityColor(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 colorcolor- 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
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 unlesssetEntityTypeColorOverridesEntityColor(boolean)is enabledIf no color is specified, but a default color is, the entities will glow that color.
- Parameters:
target- The EntityType that will glow the specified colorcolor- 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 sheepSee
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 sheepSee
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 ifsetDefaultOverridesAll(boolean)is used- Parameters:
entity- The entity that will be cleared from the coloruseDefaultColorInstead- 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 ifsetDefaultOverridesAll(boolean)is used.This will also clear the rainbow/random/custom color!
- Parameters:
entityType- The EntityType that will be cleared from the coloruseDefaultColorInstead- Weather or not to use the default color or #ffffff
-
getColor
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
ColorUtilsto manipulate it- Parameters:
target- The Entity to check the color for- Returns:
- The color string associated to that entity
-
getColor
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
ColorUtilsto manipulate it- Parameters:
target- The EntityType to check the color for- Returns:
- The color string associated to that EntityType
-
getGlobalColor
Gets the global/default custom glow colorThe 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
ColorUtilsto manipulate it- Returns:
- The color string associated to the global color
-
getDefaultColor
An alias ofgetGlobalColor()- 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 usingsetDefaultColor(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 usingsetDefaultColor(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)andsetEntityTypeColorOverridesEntityColor(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 colorcolor- 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 datapackcolorViewer- 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 ifsetDefaultOverridesAll(boolean)is usedIT WILL ONLY CLEAR THE COLOR SET BY
setExclusiveColorFor(Entity, String, PlayerEntity)- Parameters:
entity- The entity that will be cleared from the colorcolorViewer- The player that is currently seeing the custom exclusive coloruseDefaultColorInstead- 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
ColorUtilsto manipulate it- Parameters:
target- The Entity to check the color forcolorViewer- 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 forcolorViewer- 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 forcolorViewer- 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.
-