Need help making a block that passively generates resources as long as an item is in the input slot.

Started by darthewolf on

Topic category: Help with Minecraft modding (Java Edition)

Joined Nov 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Need help making a block that passively generates resources as long as an item is in the input slot.

I need help making a block that passively generates materials depending on what material is in the input slot without any input like a button.
Gui
This is what the gui looks like, with the top slot being the input.
Code

This is what i have for the resource generation code. It works when its activated via gui button, but thats not how i want it to work. I'd like it to do this every 200-500 ticks that the specified item is in the input slot. (I would also like to have it work for other items with different outputs, as i plan on making more planetoid items)
Thank you in advance for the help, and sorry if i am not portraying my requests very well as english is not my strongsuit.

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
This is just a custom…
Fri, 05/08/2026 - 09:07

This is just a custom furnace, you do the same thing as a furnace. The items will not passively work within the gui if the gui is not open so you need to use variables/nbt on the block in order for it to work.

Check out the procedure templates. You want a procedure on tick, check for item_1 in slot_0, if so is cooldown timer = 0, if so add item_2 to slot_1, if not +1 to cooldown timer. Then add more checks for the various inputs and their different outputs. Dont use a cooldown if you want an item to be generated per tick.

You have to save the data when you put an item into the input slot. For example, you use a number property, when you put an iron ingot into the input slot, it applied a number property of 2 to the block. The block on tick sees it has the number property of 2 and begins to add on to another number property called amount_generated or something. Then when you open the gui, the gui checks what is in the input slot, if its an iron ingot it adds (amount_generated number nbt) number of materials you want to generate into the output slot.