Procedure for removing certain blocks within a certain radius

Started by ProlinPlayz43 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Mar 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Procedure for removing certain blocks within a certain radius

i am making a custom item ive called a miners dream, i want it to basically be the miners dream from orespawn

in the item/triggers i have a procedure under the "When right-clicked on block (block pos)" trigger

all i need to know is how i can remove, lets say dirt, deepslate, and all variants of stone 5 up from the player, 5 left and right of the player, and 25 blocks ahead of the player
preferably with the ability to add more blocks, and change the numbers for the range or radius or whatever you want to call it but pretty sure you would be able to change them anyway

if anyone could help me achieve this it would help me out a lot

please let me know if you need anything from me id be happy to provide it

as an answer, please let me know where to find blocks needed, for example, "block procedures / Actions / Place block at x:x y:y z:z"
otherwise im going to end up skipping over it and wondering where the hell it is and it would just make life easier

thanks in advance for anyone who helps

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You need to use a modified…
Wed, 04/10/2024 - 14:31

You need to use a modified version of the 'check for block in 6*6*6 box' procedure template. It's found in the 'procedure templates' tab. 

The basic idea is that this procedure uses repeat loops and three local variables to target every block in a large box centered at an x/y/z position. By default, it sets another local variable to true, and executes something if this variable is true. (It returns true if it finds a specific block in the box.) You want to remove this, and instead have it check if the block is a stone-material, and break/drop if it is. (Instead of changing the variable, check if the block at x+sx, y+sy, z+sz is stone, and, if it is, break that block.) 

You can change the size of the box by changing the repeat brackets and the starting position. (By default it's a 6*6*6 box. To make it 5*25*5, you would need to changethe starting positions to -2, and the repeat values to 5/25/5 respectively.) To make it extend in front of the player, you would need four different versions of this depending on which direction the player is facing.