Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.16.4] Question on implementing recipes based on NBT data


Recommended Posts

I have a few questions about recipes, or my options for what I want, and I want to ask them before I start implementing code.

I have a block that holds experience, and there is an input and output. Currently I just have a book that holds experience as an NBT tag.

But in the future I want to fill a bottle with experience for other uses. Right now I look to see if the tag is present and then take the exp from it, but this doesn't work for what I want in the future.

 

Should I make a Recipe type for this block -- but my question here is how can I use the nbt data of the item and output the item with no tag?

 

Sorry if I don't make much sense here. Basically I have an item with nbt data that is drawn out of the item and into the block, but I want to "future-proof" it so I don't have any problems in next time.

Link to post
Share on other sites

I was thinking, have the Recipe type and put the recipe for the item as (Item Input) -> (Item Output), and put the timeTaken as some arbitrary number like 0/60. Then when I actually put the item in, it checks if it has the NBT tag and then give it a custom timeTaken based on how full it is. That way a half full item won't take as long as a completely full item. And if the item doesnt have the tag, then it will check if there is a recipe that uses it and it will have the correct timeTaken.

 

I don't know if this is the best way tbh, this is just me thinking based on what I know so far. If anybody has a better way then I'd love to hear it.

Thank you.

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.   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.



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • I want to make texture pack and I have a problem with models. I want to make sides of diamond armor logner, can anybody help me? When i change this in layers, and render my texture pack it just turning to mess.
    • Experienced modders, I come to you with hat in hand and request if you could share with me your thoughts and suggestions for a direction I should take on implementing a feature in my mod. First, the concept. What I would like to achieve is to provide the end user a json config file in which they can place a list of biomes and provide some addition details/criteria to apply to the world generation about those biomes. The first I would like to achieve is applying a min and max distance that a biome can spawn at from the center of the world. For example, if they wanted to make sure that desert biome was never any closer to 0, 0 then say 200 blocks they could have that in the json and then the world would skip desert as an allowed biome whenever the player is generating terrain before 200 blocks out. So far I have been able to implement my own WorldType and BiomeProvider and strong arm the getBiomeNoise function to check the distance loaded in from center against the value loaded in from the config file and just wholesale swap it for a different hardcoded biome choice, but obvious that brute force attack is not ideal at all. So I have two questions maybe you can offer advise about: 1. I would actually like this feature to allow whatever the existing generation algorithm is to do its things and just make this one additional criteria check, but obviously this seems unlikely. I have been reading up on Mixins but I am not sure yet if this will let me achieve my goals or if I even SHOULD go that route. 2. What do you think is a better strategy for replacing the chosen biome with a new one? Look for the closest neighbor biome and go that route? Whats the best way to do that?   Thanks ahead of time for anyone who even bothered to read this lol.
    • Yeah, I changed the JAVA_HOME variable to the path of my JDK (C:\Program Files\Java\jdk1.8.0_281) and it worked. Thanks.
    • use NetworkHooks#openGui look how minecraft create container, but basically you need the container and a screen tutorials are not the best solution to learn something, read the forge docs and look here in the forum, then try to create a container, if you have problems creating it you can still ask
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.