Custom Colors - MehVahdJukaar/polytone GitHub Wiki
Custom Colors feature allows to change some hardcoded color values via a simple text file in your Resource Pack.
These properties are defined in a colors.json (Preferred) or color.properties file located in assets/[your pack namespace]/polytone/color.properties or in assets/[your pack namespace]/polytone/colors.json
Inside the file you will be able to insert a list of color names and their HEX color value. The final file could look something like this:
map.grass = 62803d
map.sand = fcefc1
map.cloth = eaeded
dye.white = 0
dye.white.firework = 04343All colors here are can also be both as plain integer (decimal color) or as hex strings.
As you might nave noticed .properties and .json are 2 of the supported schema, with the Properties file being there for legacy reason as its more familiar to resource pack creator and its simplidify suits itself well for a string to color mapping system such as this one.
That being said, when possible, you should however prefer using Json format as it's more powerul and cleaner. Some features, speciically anything that has IDs, ONLY work with .json schema.
Here's an example of two files in the different schemas having equivalent semantics. For more info google both standards, they are nothing specific to MC.
Properties syntax:
dye.black.firework = e3223
dye.black.text = 23532
dye.yellow.text = 8
map.grass = 777Json syntax:
{
"dye": {
"black": {
"firework": "ff00ff",
"text": "23532"
}
"yellow": {
"text": "8"
}
}
"map": {
"grass": "777"
}
}Below I'll use both standards interchangeably, just know how one is translated to the other. I suggest you use .json format so you get familiar with it as its widely used in all vanilla datapack stuff already and is used for all other Polytone objects.
These are the 64 separate colors that can be displayed on a map. Each block can have one associated. Note that if you want to change which block has a certain color instead of changing that color value you should refer the (link) Custom Block Properties section.
MAP COLORS LIST
| Color Name |
|---|
| map.none |
| map.grass |
| map.sand |
| map.wool |
| map.fire |
| map.ice |
| map.metal |
| map.plant |
| map.snow |
| map.clay |
| map.dirt |
| map.stone |
| map.water |
| map.wood |
| map.quartz |
| map.color_orange |
| map.color_magenta |
| map.color_light_blue |
| map.color_yellow |
| map.color_light_green |
| map.color_pink |
| map.color_gray |
| map.color_light_gray |
| map.color_cyan |
| map.color_purple |
| map.color_blue |
| map.color_brown |
| map.color_green |
| map.color_red |
| map.color_black |
| map.gold |
| map.diamond |
| map.lapis |
| map.emerald |
| map.podzol |
| map.nether |
| map.terracotta_white |
| map.terracotta_orange |
| map.terracotta_magenta |
| map.terracotta_light_blue |
| map.terracotta_yellow |
| map.terracotta_light_green |
| map.terracotta_pink |
| map.terracotta_gray |
| map.terracotta_light_gray |
| map.terracotta_cyan |
| map.terracotta_purple |
| map.terracotta_blue |
| map.terracotta_brown |
| map.terracotta_green |
| map.terracotta_red |
| map.terracotta_black |
| map.crimson_nylium |
| map.crimson_stem |
| map.warped_hyphae |
| map.warped_wart_block |
| map.deepslate |
| map.raw_iron |
| map.glow_lichen |
Here's an example
{
"map": {
"gold": "-1",
"deepslate": "0"
}
}Each DyeColor has 3 color values associated to it. More precisely
- Texture Diffuse Color (main color, used for beacons, collars and fish)
- Firework Color
- Text Color
Using color.properties you'll be able to chage each of these values using the syntax dye.[dye name].[color type]. This also works with colors added by mods of course.
| Color Type | Example |
|---|---|
| Diffuse | dye.red.diffuse (or just dye.red) |
| Fireworks | dye.orange.firework |
| Text | dye.light_blue.text |
Particle colors allows to easily change the color of ANY particle, modded or not.
To do so simply add the key particle.[full particle id]. As value you can either assign a color number or a Math Expression.
This feature is just allows changing to a static color. For more control use the Particle Modifier system instead.
Here's an example
particle.minecraft:portal = 23223
particle.poof = 0Special color that redstone block applies to redstone particle. Again you could do this with particle modifiers but wouldbe trickier since redstone does NOT have a dedicated particle. Colors here allow you to replace the color array that is used in there directly. Specify color from 0 to 15 to work poperly.
redstone.0 = ff00ff
redstone.1 = bb00ff
...
redstone.15 = 220000ffHere you can change the color and offset of the fishing line from a fishing rod
{
"fishing_line": {
"color": "0xff00ffff",
"offset": {
"x": 1,
"y": 1,
"z": 2
}
}
}This feature is 1.21.1 or less only as it's not needed in new MC version as you know.
Spawn egg colors can be changed by using the key egg.spots.[full spawn egg item id] or egg.shell.[full spawn egg item id]. If the entity spawn egg follows standard namig convention you can also omit the _spawn_egg part
Here's an example.
{
"egg": {
"minecraft:villager_spawn_egg":{
"shell": 23223,
"spots": "23fa43"
},
"pig": "0xffaaffff"
}
}Used to change the world border colors. Here listed are them with their default values
{
"world_border":{
"growing": "4259712",
"shrinking": "16724016",
"stationary": "2138367"
}
}To change a Mob Effect (the ones you get from potions and similar) color you can use the string effect.[full mob effect id]
Note that the id is the one of the Mob Effect and not the one of the Potion!
For legacy reason the key potion. will also work but this is DEPRECATED and only there to assure backward compatibility with Optifine packs. Potions and Mob effects are 2 different things in the game, the correct name is Mob Effect.
Adding the paticle key will allow you to change the particle of the effect (1.21.4+)
You can also change the Water Bottle and Empty Potion colors using the special keywords water and empty.
Here's an example
{
"effect": {
"minecraft:poison": {
"color": "0xff00ffff",
"particle": "minecraft:poof"
}
}
}Or using the older format:
effect.absorption = a32124
effect.minecraft:poison = 12231
effect.water = 0000bb
effect.empty = 444444You know the drill by now. Note that these will also change according to dye color but will have priority
sheep.white = ff00ff00
sheep.red = 4The game has 16 color codes that you can use in books, signs and similar. Their names do not match the dye color names so be sure to check them on the Minecraft Wiki. To change them you can either reference their numerical code or their name directly as such:
text.code.0 = ff00ff
text.gold = ffff00Title screen splash color
{
"text":{
"splash": "0x00ff22"
}
}Changes the xp number on your xp bar. Uses text.xpbar like so
{
"text":{
"xpbar": "0x00ff22"
}
}or like so:
{
"text":{
"xpbar": {
"foreground": "0x00ff22",
"background": "-1"
}
}
}Changes the color of xp orbs entities.
You can either define a color or its red green and blue components.
The content here will actually be an Expression that can use the TIME and POS_X, POS_Y, POS_Z variables. Check out the Scriptiong section.
{
"xporb":{
"red": "1",
"green": "0.2",
"blue": "0.5*(sin(TIME)+1)"
}
}This section is 1.21.11 and is discouraged. Try to use Colormaps in Block Modifiers when you can. What this does is much simpler and closer to vanilla logic. For more control use colormaps together with Block Modifiers. The 3 colors here define alter the hardcoded vanilla special grass colors (which can be disabled with Block Modifiers) and that just affect dark oak and swamp coloring.
{
"special_grass_color":{
"swamp_dark": -1,
"swamp_light": -1,
"dark_forest": "0xff00ffff"
}
}
This is 1.21.11+ only.
This is a misc category that contains some colors and other parameters. Here is an example:
{
"environment": {
"sky_flash": "0xff00ffff",
"void_darkness_offset": 40,
"horizon_height": 70
}
}
These control respectively the sky flash color, the void darkness effect offset from min y and the level horizon height. These are global and not per dimension as thats how vanilla game has them setup. Moreover the last 2 don't affect superflat. Default values are [204, 204, 255], 32 and 63 respectively.