How to make blocks of a specific type in a radius be replaced by another block?

Started by beans-against-… on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jun 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make blocks of a specific type in a radius be replaced by another block?

I'm trying to make blocks in a specific radius be replaced by dirt after a block is right-clicked by bonemeal, I have everything but the replacing script ready, how do I do this?

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Use the 'Search for block in…
Tue, 12/27/2022 - 17:22

Use the 'Search for block in 6*6 box' procedure preset. It uses three variables, (sx, sz, and sy), to determine the positions of blocks in relation to the source location, and then sets a 'found' variable to true if a block at the offset matches a desired block. Instead of using it to search for a block, you can replace the central part of the procedure so that it replaces the block at sx sy sz, if it matches a desired block. You can also configure the size of the box, or add a randomization aspect to it so it doesn't replace all of them.