procedure repeat help

Started by wolferinet on

Topic category: Help with Minecraft modding (Java Edition)

Active 2 years ago
Joined Aug 2015
Points:
722

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 6
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.
Active 1 year ago
Joined Mar 2022
Points:
537

User statistics:

  • Modifications: 1
  • Forum topics: 3
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 121
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