How to replace all non-air blocks in an area

Started by Hyperkiller on

Topic category: Help with modding (Java Edition)

Last seen on 02:15, 11. Apr 2024
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to replace all non-air blocks in an area

I would like to make a procedure that replaces all non-air blocks in an area with another block (eg; stone). Can anyone tell me how I would do this?

Last seen on 13:23, 24. Apr 2024
Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
The "Check for block in…
Mon, 03/25/2024 - 00:45

The "Check for block in 6x6x6 cube" procedure template has the loop setup required to check all blacks in an area, you can then change the part that checks if the block at the modified location is a certain block and replace it with "not""is air at X Y Z" but switch the X, Y, Z to X+sx, Y+sy, Z+sz.

Also change it so that instead of setting found to true, it places the block you want at X+sx, Y+sy, Z+sz, but in the same if block as the set found to true.

One more thing, remove the empty if found equals true loop, as you don't need it.

Also, I will not send an image of the procedure as I do not use image hosting websites.