Custom Colorful Enchantment
Customizing Enchantment Colors
This module offers flexible options for modifying the visual effects of enchanted items. Players can use JSON configuration files or create additional modules to adjust enchantment glow.
JSON Configuration
The main configuration file is located at config/colorful_enchantment_cfg.json. The file structure includes a Colors array containing various lighting effects.
Type: custom_colorful_enhancement:enhancement
Example configuration for enchantments:
{
"Type": "custom_colorful_enhancement:enhancement",
"_comment_type": "But accept_all means accepting all items -- always true",
'_accept_all': true,
"Enhancement": "minecraft:fire_protection",
Color: 16711680,
"_comment_color": "16777215 is #FFFFFF"
}
The type parameter specifies the lighting element type. With accept_all present, the setting applies to all enchantments; otherwise, it applies only to the specified Enhancement. Color is set in RGB format.
Type: custom_colorful_enchantment:ingredient
Example for ingredients:
{
"Type": "custom_colorful_enchantment:ingredient",
"_comment_type": "But accept_all means accepting all items -- always true",
'_accept_all': true,
Color: 3928840,
"_comment_color": "65535 is #3BD308",
'ingredient':{
"Item": "minecraft:wool",
Data: 0
},
"_comment_ingredient": "an ingredient used in recipe JSON"
}
With accept_all present, the setting applies to all items; otherwise, it applies only to the specified ingredient. The ingredient parameter determines the item for synthesis.
API for Developers
JSON Loaders
To register, listen to com.Hileb.custom_Colorful_Enchantment.api.registry.ColorFactoryRegistry$RegistryEvent. The module includes two loaders:
- custom_colorful_enhancement:enhancement
- custom_colorful_enhancement:ingredient
Color Generators
To register, listen to com.Hileb.custom_Colorful_Enchantment.api.registry.ColorInstancesRegistry$RegistryEvent. Two generators are available:
- minecraft:enhancement - standard enchantment effect #8040CB
- custom_colorful_enhancement:nbt - uses enhancement_color value from item NBT
Rendering System
The module disables the standard enchantment glow display. All lighting effects are collected, averaged, and rendered together.
