Break a random block within a radius, every tick.

Started by AlexTheAwesome on

Topic category: Help with MCreator software

Joined Oct 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Break a random block within a radius, every tick.

I managed it, somewhat, by making 3 variables for x, y, and z, and setting them to (Random(0,1)+Random(0,1))+(Random(0,1)+Random(0,1)) each, and then adding them to the x coordinate of the player, detecting if it's stone, and if it is, breaking it and dropping it at the player. Then, I did the same, but with negative coordinate values. It's a huge mess. Is there a simpler way of going about this? I'd like it to (every tick) pick a block that's within 5(or more, though more would take longer and possibly be laggier) blocks of the player, in any direction except down, and if it's stone, break it, so you can wander around, collect stone, and mine whatever ores are now floating in the air.

Joined Oct 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I think the main thing that…
Tue, 12/11/2018 - 00:46

I think the main thing that would be helpful is having a way to change the random value range. Is there a way to do that?

Joined Jun 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Use this: Set variable 1 to …
Tue, 12/11/2018 - 14:14

Use this:

Set variable 1 to {x + [(random × 10) - 5]}

Set variable 2 to {z + [(random × 10) - 5]} 

If (get block at (variable 1), y, (variable 3) = stone

Destroy block at (variable 1), y, (variable 2) drop at x, y, z