-
-
Notifications
You must be signed in to change notification settings - Fork 1
3: Custom color animations
Starting from version 3.0.0 of the mod, you can now add color animations. They are set of colors (or other animations!) that repeat every tot seconds, like the Christmas Tree's lights.
This is done by creating a datapack like the one provied in the example, in which you will add configurations that create your animation.
- Step one: Download the example datapack
- Step two: Reneame it, do whatever you want to do with the pack.mcmeta settings etc.
- Step three: Go inside the folders, you will see that there are two json files. These are the two example files that specify the custom animations. You can look at them for reference, and after you are done with creating your own you can rename/remove them from the pack.
You will see that they will hava structure similar to this:
{
"name": "<animation_name>",
"colors": [
{
"color": "<your_first_color",
"active_for": <duration_ticks>
},
{
"color": "<your_second_color",
"active_for": <duration_ticks>
}
]
}
The name
is a String, representig the name/id of the animation, that is going to be used to set this color animation as a custom color for an entity, using the API or the /cgl setglowcolor command. If multiple color animations share the same name, only the first one to be loaded will actually work, while the other won't even be loaded in.
Then there is a list of colors
. The animation will proceed from the first one to the top, all the way to the bottom, and then cycle back to the top in a loop.
Every element inside the list has color
, which is the color that will be displayed in that animation "frame". You can use an RGB hex color string (like "ABC" or "f099a12" etc), or "rainbow", or "random", or another custom animation's name that is different from the one you are currently using.
Then there is the active_for
, which determines how much in ticks (1 seconds = 20 ticks) the color will be displayed for. Note: if the color you have set is one from another custom animation, remember to make the duration at least as long as the overoll duration of that other custom animation, otherwise the color will be changed before it finishes.
- Step 4: Create your custom animation file, and the name, and the color frames. You can even edit the example ones.
- Step 5: Now add the datapack to your server/world and use the /reload command.
- Step 6: Profit. Now you can use /cgl setglowcolor "your_custom_animation_name" to see your animation in game!
Note, if you at some point remove the animation, entities and stuff will still try to glow that color, glowing black instead. Remember to clear theri color if you do so!
You can directly add the contents of the coloredglowlib
foloder to your mod's data
folder to have your custom animation available directly with your mod!