2

I want to make a command block that detects water blocks anywhere in my world, and then replace it with ice, but I don't know how to detect blocks without testing specific coordinates one by one. For example, this won't work because I have to repeat for every single coordinate I want to test:

/execute if block 12 23 34 water run setblock 12 23 34 ice

I also want it to detect blocks everywhere without being restricted by distance from the player or other entities.

1
  • Welcome to Stack exchange! Take some time to read the Tour, and make sure your questions are good. I left an upvote, so now you have a little more rep. Commented Nov 20, 2020 at 17:13

1 Answer 1

2

The command syntax is

/fill <from> <to> <block> replace [<filter>]

So in your case it is something like

/fill ~-25 ~-10 ~-25 ~25 ~10 ~25 minecraft:ice replace minecraft:water

which would be execute off of the player every few seconds to get it all. This wouldn't get it all at once but wherever the player moves.


Note this may work slower if a lot of people are in the same world.

1
  • So THAT was the command! Spent forever trying to find one that worked, but ya beat me to it. Good job! Commented Nov 21, 2020 at 1:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.