Machine timer / on-tick issue

Started by Plasmot on

Topic category: Help with Minecraft modding (Java Edition)

Joined Aug 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Machine timer / on-tick issue

Hey everyone,
first of all — yes, I know there’s already a tutorial for an oven that technically covers my exact question.
But I honestly have no idea why nothing’s working for me, and I’d really appreciate some help understanding it.

I basically did everything pretty similar to the tutorial, but the part about NBT tags wasn’t explained very well — and that’s kinda the most important bit for my setup.

Here’s what I’m trying to do:
I want to combine two items inside my custom machine. After a short time (about 1 second = 20 ticks), the final product should appear in the output slot.
That could work perfectly fine… except I can’t attach my procedure to the on-tick trigger, because it uses things like target/entity, which obviously don’t exist in that context.

My current “solution” is this:

  • I already had a button in my GUI.
  • The item should only be processed when that button is pressed.
  • The button runs a procedure that checks if all the right items are in place, and if so, it sets a logic tag processing = true and a number tag timer = 0.
  • The block’s on-tick procedure increases that timer by 1 each tick while processing = true.

Then, in the GUI, I attached another procedure to one of the material slots.
That procedure checks whether all conditions are still met.
When the timer reaches 20, it consumes the materials from slots 0 and 1 and places the output item in slot 2.
After that, it resets the timer to 0 again.

The second if statement checks whether there’s enough space in the output slot — if not, it resets timer = 0 and processing = false.

Here’s the code in case anyone wants to take a look (ignore those weird ass names XD):

https://ibb.co/SXw2CtXN

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
gotta hit that em dash quota…
Mon, 10/20/2025 - 12:47

gotta hit that em dash quota

 

you can get the items in slots of blocks without a player using these blocks,