Trying to make an Electric furnace

Started by Loam on

Topic category: Help with MCreator software

Last seen on 13:37, 10. Apr 2023
Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Trying to make an Electric furnace

Hello! I am trying to make an electric furnace in mcreator (runs on FE), but I can't get it to work, I can get it 95% to work, but the wait procedure is really annoying. Is there anyway anybody could help me with this?

It just waits 20 ticks then smelts the entire thing instantaneously rather than doing it once then looping to waiting another 20 ticks and then smelting another and so on, so forth.

My procedure code sort-of looks like this if written out (sorry, i don't know how to import images):

&& = and
|| = or

Slot Zero = What is gonna be smelted
Slot One = Output

On Tick:
if(energyOfBlock => 3 && 
   itemsInSlotOne < 64 &&
   itemsInSlotZero > 0 &&
   (itemInSlotOne == copyOfSmeltingResultOfSlotZero || itemsInSlotOne == 0)
   )
then {
   wait(20) {
       extractEnergy(x, y, z, 3FE)
       if(itemsInSlotOne < 64 &&
           itemsInSlotZero > 0 &&
          )
       {
         setItemToSlotOne(itemsInSlotOne += 1, copyOfSmeltingResultOfSlotZero)
       }
       if(itemsInSlotOne < 64 &&
           itemsInSlotZero > 0 &&
          )
       {
         removeItemFromSlotZero(1)
       }
   }
}
 

Last seen on 05:13, 9. Nov 2023
Joined Mar 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
The "Wait" block you mean is…
Sat, 04/01/2023 - 23:19

The "Wait" block you mean is the "Wait X Ticks then do Server Side" one? Any code inside of that block is being "queued" up in the server, and the rest of the code after the wait block will still execute. In this case that means it will queue another wait event every tick (20/second) rather than delaying the execution of the next tick until the wait is complete. 

If it's a block (sounds like it is) you can simply set how often the Ticks to trigger every 20 Ticks and remove the wait entirely, or setting it to 1 tick if you need to force something server side. This is the 'Tick rate:" option under "Advanced properties" of the block you're making.

 If you want the procedure to run once every X ticks, the best bet that I have found is to put everything inside of this:

if(getWorldTime % 20 == 0)

In the block building GUI '%' is called 'MOD' and is one of the options in the mathematical equations block (same as +, -, * etc. etc)

Here it is in code blocks:

But, again, you shouldn't need to use that if it's a machine block anyways, as you can manually set the tick rate instead.

Last seen on 17:59, 7. Jan 2024
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Use the procedure template …
Sun, 04/02/2023 - 10:11

Use the procedure template "spawn gem every 10 times this event is called". From here, add your code on the inside and outside, and change the number to make it work properly (you may need to increase it or decrease it).