procedure repeat help

Started by wolferinet on

Topic category: Help with modding (Java Edition)

Last seen on 11:35, 9. Apr 2023
Joined Aug 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
procedure repeat help
hello, good evening, I would like someone to explain to me how the procedure works, repeat, since I did not find a video or relevant information in the forum, the idea is very easy: a machine that mines stones is recharged with a package of 64 items, it consumes them and it works by mining 64 blocks.
I've been creating simple mods for many years, but what little programming I know I learned on my own and without speaking English, so if someone can explain it to me with a practical text or a .ptpl file, I'd be very grateful, thank you very much for everything.
Last seen on 19:37, 27. Apr 2024
Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It's possible with theā€¦
Fri, 05/12/2023 - 18:31

It's possible with the MCreator programmation blocks :

Your procedure could look like this (I don't have the real english name of these blocks so I give you an approximate translation)
First you need to create a local variable called i.

set i on 1
repeat 64 times:
	if obtain direction of the bloc at x y z = south
		remove block at x y z+i
		set i to i+1
		remove [object] from inventory of the block at x y z
	if obtain direction of the bloc at x y z = north
		remove block at x y z-i
		set i to i+1
		remove [object] from inventory of the block at x y z
	if obtain direction of the bloc at x y z = east
		remove block at x+i y z
		set i to i+1
		remove [object] from inventory of the block at x y z
	if obtain direction of the bloc at x y z = west
		remove block at x-i y z
		set i to i+1
		remove [object] from inventory of the block at x y z