Jump to content

Recommended Posts

Posted

I want an item, that when crafted with different dyes, changes its nbt to reflect the average color, like dyeing leather armor/ sort-of like fireworks. The only thing I can assume I need is two textures, one for static colors, and another for one that is dynamically changed with the color, which would be overlayed onto the first. And how could I take that item and craft it into a block (for example) and still have that block retain its color? or armor crafted with the same item?

Professional Hot Garbage Programmer.

https://github.com/Bedrockbreaker/

Posted
26 minutes ago, _Bedrockbreaker_ said:

I want an item, that when crafted with different dyes, changes its nbt to reflect the average color, like dyeing leather armor/ sort-of like fireworks. The only thing I can assume I need is two textures, one for static colors, and another for one that is dynamically changed with the color, which would be overlayed onto the first. And how could I take that item and craft it into a block (for example) and still have that block retain its color? or armor crafted with the same item?

You will need to make a custom IRecipe implementation. You should look at the ItemArmor for how the LeatherArmor texture works.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

  • 2 weeks later...
Posted

Recipes now use the Forge registry system, so subscribe to RegistryEvent.Register<IRecipe> and register an instance of the recipe using IForgeRegistry#register.

 

When possible, you should register recipes through JSON files rather than in code. To allow your IRecipe class to be used by JSON files, create an IRecipeFactory class for it and specify it in _factories.json.

 

You can see some examples of IRecipe and IRecipeFactory implementations here, the _factories.json file here and the recipe files here.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted
6 hours ago, _Bedrockbreaker_ said:

Yes, most of my recipes are registered through json, but I don't think that json allows you to do advanced recipes that give nbt-specific items based on certain inputs. (armor dying)

 

It does if you create your own recipe class and factory, as I explained in my previous post.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted
8 hours ago, Choonster said:

 

It does if you create your own recipe class and factory, as I explained in my previous post.

Okay... It just seems the vanilla classes to register the armor dying (or it seems anything that uses dying/cloning items/tipped arrows) don't use jsons... Will try to move my class to json though...

Professional Hot Garbage Programmer.

https://github.com/Bedrockbreaker/

Posted

(This is just to check to see if I have the right idea) Okay, So when looking at the files, you have gold_helmet_from_iron_helmet.json that actually specifies the recipe. The type tag on the json specifies the class that _factories.json uses to modify that recipe. (What does the data tag do on the iron helmet?) Then, the ShapedArmorUpgradeRecipe which iterates over the crafting slots until it finds an armor piece. Then, it takes the damage of the iron helmet, and copies it onto the golden helmet. (doesn't the iron helmet have more durability, which wouldn't effect the golden helmet until the iron helmet's durability got low enough? Or does it take any damage on the iron helmet on apply it to the golden helmet, meaning that a barely broken iron helmet could result in a completely broken golden helmet? Or is it a ratio, which I see none of in the class, that as the iron helmet takes more damage, the golden takes less, but both meet at 0.)

Professional Hot Garbage Programmer.

https://github.com/Bedrockbreaker/

Posted
3 minutes ago, _Bedrockbreaker_ said:

(What does the data tag do on the iron helmet?)

 

32767 is the value of OreDictionary.WILDCARD_VALUE, which tells the Ingredient to accept any metadata value of the item. This allow an Iron Helmet with any amount of damage to be used in the recipe.

 

4 minutes ago, _Bedrockbreaker_ said:

Then, it takes the damage of the iron helmet, and copies it onto the golden helmet. (doesn't the iron helmet have more durability, which wouldn't effect the golden helmet until the iron helmet's durability got low enough? Or does it take any damage on the iron helmet on apply it to the golden helmet, meaning that a barely broken iron helmet could result in a completely broken golden helmet? Or is it a ratio, which I see none of in the class, that as the iron helmet takes more damage, the golden takes less, but both meet at 0.)

 

Minecraft uses the metadata as the amount of damage the item has taken, so 0 is no damage and X (where X is the maximum damage) is just about to break.

 

ShapedArmourUpgradeRecipe clamps the output item's damage between 0 and its max damage, so if the Iron Helmet has more than 77 damage (the max damage of a Gold Helmet), the damage on the Gold Helmet will be clamped to 77. This means that an Iron Helmet with anywhere from 0 to 88 durability will be converted to a Gold Helmet with 0 durability.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Hi, i'm really having problems trying to set the texture to my custom item. I thought i'm doing everything correctly, but all i see is the missing texture block for my item. I am trying this for over a week now and getting really frustrated. The only time i could make the texture work, was when i used an older Forge version (52.0.1) for Minecraft (1.21.4). Was there a fundamental change for textures and models somewhere between versions that i'm missing? I started with Forge 54.1.0 and had this problem, so in my frustration i tried many things: Upgrading to Forge 54.1.1, created multiple new projects, workspaces, redownloaded everything and setting things up multiple times, as it was suggested in an older thread. Therea are no errors in the console logs, but maybe i'm blind, so i pasted the console logs to pastebin anyway: https://pastebin.com/zAM8RiUN The only time i see an error is when i change the models JSON file to an incorrect JSON which makes sense and that suggests to me it is actually reading the JSON file.   I set the github repository to public, i would be so thankful if anyone could take a look and tell me what i did wrong: https://github.com/xLorkin/teleport_pug_forge   As a note: i'm pretty new to modding, this is my first mod ever. But i'm used to programming. I had some up and downs, but through reading the documentation, using google and experimenting, i could solve all other problems. I only started modding for Minecraft because my son is such a big fan and wanted this mod.
    • Please read the FAQ (link in orange bar at top of page), and post logs as described there.
    • Hello fellow Minecrafters! I recently returned to Minecraft and realized I needed a wiki that displays basic information easily and had great user navigation. That’s why I decided to build: MinecraftSearch — a site by a Minecraft fan, for Minecraft fans. Key Features So Far Straight-to-the-Point Info: No extra fluff; just the essentials on items, mobs, recipes, loot and more. Clean & Intuitive Layout: Easy navigation so you spend less time scrolling and more time playing. Optimized Search: Search for anything—items, mobs, blocks—and get results instantly. What I’m Thinking of Adding More data/information: Catch chances for fishing rod, traveling villager trades, biomes info and a lot more. The website is still under development and need a lot more data added. Community Contributions: Potential for user-uploaded tips for items/mobs/blocks in the future. Feature Requests Welcome: Your ideas could shape how the wiki evolves! You can see my roadmap at the About page https://minecraftsearch.com/about I’d love for you to check out MinecraftSearch and see if it helps you find the info you need faster. Feedback is crucial—I want to develop this further based on what the community needs most, so please let me know what you think. Thanks, and happy crafting!
    • Instructions on how to install newer Java can be found in the FAQ
    • That's just plain wrong... newer versions are much better optimised and start a lot faster than 1.8.9, both Forge and Minecraft itself. Comparing Fabric 1.21 with Forge 1.8 is like comparing apples and oranges... one's brand new and the other's over a decade old.
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.