Item programmatically coloring

Started by Lemon4ik_23234 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jun 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Item programmatically coloring

have a mod where you need to programmatically set color to a black and white overlay. There is a potion item and a liquid item of this potion, here is their JSON code:

potion: 

{
  "parent": "item/generated",
  "textures": {
    "layer0": "alhimia:item/bottle"
  },
  "overrides": [
      {"predicate": {"custom_model_data":1}, "model": "alhimia:item/fluid"}
      ]
}

fluid: 

{
  "parent": "item/generated",
  "textures": {
    "layer0": "alhimia:item/fluid",
    "layer1": "alhimia:item/bottle"
  }
}

 And it is necessary that the liquid in the potion be colored using the NBT tag programmatically, because it is too expensive to draw a texture for each shade. I got into the json of minecraft, but everything coincided with my project, therefore the magic lurks somewhere in the java code of the subject, but it will not be possible to parse the jar file back into the project. I'm zero in java programming so it's better to write complete code and how it all works.