Break a random block within a radius, every tick.

Started by AlexTheAwesome on Tue, 12/11/2018 - 00:42

Topic category: Help with MCreator software

Last seen on 16:54, 24. Jun 2020
Joined Oct 2014
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Break a random block within a radius, every tick.
Tue, 12/11/2018 - 00:42

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.

Last seen on 16:54, 24. Jun 2020
Joined Oct 2014
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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?

Last seen on 13:18, 2. Dec 2020
Joined Jun 2016
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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