Started by
minecraftepic
on
Topic category: Help with Minecraft modding (Java Edition)
im trying to make an clay furnace that only smelts specific ore like copper etc
right now no tutorial makes sense to me or is for my version 2025.2 neoforge
Without animation, Create "Off Block" Create "On Block". Create 4 procedures, "FurnaceOffOnTickProcedure" that runs every tick for the "Off Block", create "FurnaceOnOnTickprocedure" that runs every tick for the "On Block", create "SmeltingResultCondition" create "WhenFurnaceBlockAdded" that runs on the block trigger "When Block Added". You will also be setting up 4 block NBT number variables, being "maxfuel" "fuel" "smeltingtime" and "smelting". All NBT variables are associated with counting game ticks.
"maxfuel"= If you wish to utilize GUI fuel and cooking progress bars, this is essential mainly for the remaining fuel progress bar. This is set at the same time as "fuel" and to the same number. I will not go into depth on the progress bars here but I will link a video I suggest you watch for a much better walkthrough that you may grasp after this explanation. Basically to show 10% 20% 30% and so on progression in the GUI you must create conditions for showing the pictures associated with each progression. For instance condition to show 90% filled in fuel meter, must check, If "fuel" is = to 9/10ths of "maxfuel", and do the same kinda thing for each progression. You can set this up with basic math within the condition procedure.
"fuel"= This is the fuel timer that is set dependent on what type of item is inserted into the blocks GUI/Inventory fuel slot. EX. Coal put into fuel slot sets "fuel" AND "maxfuel" to "1600" or Wood put into fuel slot sets "fuel" AND "maxfuel" to "300". These numbers representing how many ticks the furnace can cook items for before attempting to consume another fuel item or shutting off.
"smeltingtime"= This is how long in game ticks the smelting process should take.
"smelting"= This is a timer that counts up to "smelting time" every tick that an item is attempting to be smelted. Simply, this is your smelting progress. You use the two smelting variables just like fuel if you want to have a smelting progress bar. IF "smelting" is = to 1/10 of "smeltingtime" then return true to show the 10% full progress arrow GUI Picture.
"WhenFurnaceBlockAdded"= Simply put SET "smeltingtime" to (your desired amount of ticks) Normal furnace takes 200, blast furnace takes 100.
"SmeltingResultCondition"= This is used to check if the item put in (your input slot) meets your set conditions needed to begin the smelting process. Must return true if item meets conditions, or false otherwise.
This needs to be checked at the top of "FurnaceOffOnTickProcedure" It also needs to be checked at the top of "FurnaceOnOnTickprocedure", if it returns true the smelting process should begin, more on that below.
"FurnaceOffOnTickProcedure"= This needs to check IF get number of items in slot (your input slot)>0 AND get number of items in slot (your fuel slot)>0 AND is get copy of item in slot (your fuel slot) tagged in item tags as "furnace:fuel" AND call procedure and get logic return value "SmeltingResultCondition" DO set "fuel" to 0 replace block with "On Block" This basically checks if there's an item in the input slot AND the fuel slot AND the item in the input slot meets your set conditions in "SmeltingResultCondition" then the furnace will turn on (change to on block) and will begin using the on tick procedure instead.
"FurnaceOnOnTickprocedure"= This procedure should begin by checking if "SmeltingResultCondition" returns true, if it returns false, there should be and else statement that replaces block with "Off Block". Otherwise it should continue to then check, if "fuel">0 then set "fuel" to "fuel"[-1]. This ensures every tick the block is on and has fuel, "fuel" will go down by 1 till "fuel" hits 0. Add an ELSE IF to this check that checks another IF "fuel"=0 THEN IF get number of items in slot (your fuel slot number)>0 AND If is get copy of item in slot (your fuel slot number) tagged in items tags as "furnace:fuel" then continue, ELSE set "maxfuel" to "-1" and set "fuel to "-1" and replace block with "Off Block" first what this does is just check if there is an item in the fuel slot, and if said item can be used as fuel. If both those statements are true it will go on to check what kind of fuel item it is, and will delete one item in that slot and set "fuel" and "maxfuel" to "1600" or "300" or really however long you want. If those checks return false, that means the item in fuel slot is NOT fuel and so it will set both fuel values to "-1" disabling these values until reset to 0 by "FurnaceOffOnTickProcedure" and will also set replace the on block with off block. Now continuing. After these checks you want to nest another IF with one ELSE that reads, IF is get copy of item from slot (your fuel slot) tagged in item tags as "furnace:fuel/coal THEN set "fuel" and "maxfuel" to "1600", ELSE set "fuel" and "maxfuel" to "300". Then, set to run regardless of fuel type, you need SET get number of items in slot (your fuel slot) to [-1], get copy of item in slot (your fuel slot) IN SLOT (your fuel slot) OF BLOCK AT x y z IF IT HAS INVENTORY. After this the fuel mechanic is finished. Now underneath the fuel stuff but not nested within it, will be the blocks that handle the smelting process. Add IF "fuel">-1 DO, IF "smelting"="smeltingtime" DO____ ELSE, SET "smelting" to "smelting"+[1]. Now I elaborate on the ____ I put. Under that DO you must put SET get number of items in slot (your output slot)+[1] get smelting result of get copy of item in slot (your input slot) IN SLOT (your output slot) OF BLOCK AT x y z IF IT HAS INVENTORY. This adds the smelting result of the item in the input slot, to the output slot. Now attach beneath this. SET get number of items in slot (your input slot)-[1] get copy of item from slot (your input slot) IN SLOT (your input slot) OF BLOCK AT x y z IF BLOCK HAS INVENTORY. This part handles the removal of one item in the input slot after adding its smelting result to the output slot.
That's probably the best I can do to explain this with text. I hope this helps anybody at least a little.. I will attach a youtube video created by NorthWestTrees that explains how to do all this is more detail with pictures. I'm sure OG uploader saw them but I think this explanation will help you understand his vid better. This vid is 1 of 3 in his furnace series.
https://youtu.be/myguBXqskhk?si=BTD3K2Vo9pkISIbq