Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Best way to create a new dye.
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 1
Eridani

Best way to create a new dye.

By Eridani, January 24 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

Eridani    0

Eridani

Eridani    0

  • Tree Puncher
  • Eridani
  • Members
  • 0
  • 2 posts
Posted January 24

Howdy! I have a simple objective, to make a new dye and fully incorporate it into the game give it its own wool, terractotta, banner, etc. Creating the dye item is easy - register dye item,  make json recipe, done. But, I want to create super classes of the dyeable items in the game and set them to this maroon tint. And I don't know how to approach this.

 

I see that many of these classes take the dyecolor as an argument, so allegedly if I simply add a color to the class I can then create many of the things I want with the new dyeColor. But since .class files are not modifiable (because they need to maintain where they come from), I cannot just add the dye . I also see the materialColor class, which I can create an new material color, but I don't know when that is used.

 

There is also a colorhandlerevent where one can set the color of a textures layer of an object - this is what I think is the needed section. As of writing this I haven't read deeply to see how sepcifically each uniuqe block is colored, but this might be the right things to use where I can get the color of each object and set it during its construction by calling the colorhandler event. At any rate, there are probably also exceptions as well (such as glazed terracotta.)

 

Just help understanding how objects are given color in general is probably all I need. Thank you in advance!

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7691

diesieben07

diesieben07    7691

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7691
  • 56337 posts
Posted January 24

Dyes and colored objects are not handled through runtime coloring, they simply have different textures, there for ColorHandlerEvent / IItemColor / IBlockColor is not the way to go.

It gets problematic, because Minecraft models dye color as an enum, which is of course inflexible and does not let you add things to it.

 

So really you just need to add new items, blocks, etc. as normal for all the colored "things" and ignore DyeColor. For things like sheep shearing, you probably either need to hook into the sheep rendering and have your own rendering for your own color (in addition to storing the fact that the sheep is "your color") or just spawn a custom sheep. Same goes for banners, you probably have to clone the complete logic, which is not really fun.

 

Overall: The basics are possible, but integrating it into the whole game is probably not possible / not easy.

  • Quote

Share this post


Link to post
Share on other sites

Eridani    0

Eridani

Eridani    0

  • Tree Puncher
  • Eridani
  • Members
  • 0
  • 2 posts
Posted January 25 (edited)

You've demystified this a little bit for me and pointed out a good note - if I want to duplicate existing items, since I have the source code I can technically copy and paste it into my own class to clone the complete logic. I'll see how that goes. 

 

Thank you!

Edited January 25 by Eridani
  • Quote

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 1
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Eksity
      Another freaking "error in currently selected datapacks prevented world from loading"

      By Eksity · Posted 6 minutes ago

      Basically the title. I Try to get into my pre-existing world, and gave me an error that said "Error in currently selected data packs prevented the world from loading." along with safe mode and return to title. I mess around with my mod list a lot because I make modded MC content for YouTube and TikTok, But the mods I have removed in the past 3 days are quark, quark oddities, quark biomes o' plenty, armorplus, and thedragonlib along with a custom mcreator mod I never uploaded anywhere. I don't use a specific modpack, but rather a collection of mods i find interesting. latest.log: https://gist.github.com/Eksity/9e4b219018a1a519c9ab615c31c629f7   is there any advice, or anything you can do to help?
    • Zeher_Monkey
      [SOLVED] 1.16.3 How to get the World Name for saving files in the /saves folder

      By Zeher_Monkey · Posted 13 minutes ago

      Very true, but to be honest my code only needed a few lines updated. I want to move to something more native, but am struggling to find references to WorldSavedData. I am not worried about compact data, there is only 1 master file which contains each registered object, and each object is only ~3KB in size. It allows easy debugging, and on servers specifically, tweaks to the data that do not require things like NBTExplorer to use. It works for my purposes.
    • Differentiation
      Is it possible to change the color of Firework Spark particle?

      By Differentiation · Posted 20 minutes ago

      Hey,   Pretty simple question: is it possible to specify a color for the firework spark particle effect when spawning it?   Thanks
    • brok4d
      Modded 1.16 fluid has no physics

      By brok4d · Posted 28 minutes ago

      Well, you should have it, since that's why you get the error, the .png files and the .mcmeta files since the .mcmeta files are for animation if I'm not mistaken. This is what the .mcmeta have. { "animation": { "frametime": 4 } }
    • sc0rich
      how do I config mods in 1.16.4?

      By sc0rich · Posted 30 minutes ago

      Oh, okay.       wait, then how do I access the configurations? do you know where do I go? how I edit .cfg and .toml files? cause I just found it
  • Topics

    • Eksity
      0
      Another freaking "error in currently selected datapacks prevented world from loading"

      By Eksity
      Started 6 minutes ago

    • Zeher_Monkey
      8
      [SOLVED] 1.16.3 How to get the World Name for saving files in the /saves folder

      By Zeher_Monkey
      Started Wednesday at 12:20 AM

    • Differentiation
      0
      Is it possible to change the color of Firework Spark particle?

      By Differentiation
      Started 20 minutes ago

    • NullDev
      3
      Modded 1.16 fluid has no physics

      By NullDev
      Started 4 hours ago

    • sc0rich
      6
      how do I config mods in 1.16.4?

      By sc0rich
      Started Yesterday at 02:11 AM

  • Who's Online (See full list)

    • Eksity
    • Hubmac
    • Pera666
    • CookieLukas
    • abbepe
    • Deadlocked47
    • Kaiser Frederick
    • Seynox
    • Differentiation
    • Pickle_Face5
    • TeaWithBebeLoca
    • brok4d
    • Seika85
    • Zeher_Monkey
    • FactionsFire
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Best way to create a new dye.
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community