1

[Command Blocks] Changing block states relative to what already exists

ICEThat 2/21/19 4:58 am
283
2/22/2019 1:22 am
https://imgur.com/jJwT60R


This might be a little hard to explain. As you can see in the image above, I have a pad with snow of different levels. minecraft:snow[layers=5] etc. What I'm wanting to do is decrease the layers value by one. I could individually /setblock every bit of snow, but I'm wondering if it's possible for me to use something like a fill or execute command that will decrease the layer value by one relative to what's already there. Did that come across okay? Thanks
Posted by
ICEThat
Level 20 : Expert Dragon
13

  Have something to say?

JoinSign in

3

Kwanatla
02/21/2019 5:34 am
Level 37 : Artisan Archer
history
Hm, not sure about this, but It might work when you first do a execute testfor block to check how many layers, than if layers equal 2, setblock snow layers 1? May require multiple command blocks, is complicated, and doesn't necessarily work, I just thought of this...
If I may ask, what are you trying to do with that?
Good luck
2
ICEThat
02/22/2019 12:47 am
Level 20 : Expert Dragon
How does the execute testblock command work? Can it check across a large area? Such as in my example image above, would I be able to have one command block that checks and changes all layers=2 into layers=1?

What I'm trying to do is create a melting effect. I'm making a "the ground is lava" thing. Over time, the amount of layers of snow will decrease until the player is touching the green terracotta, upon which they will be killed. The reason I'm wanting to decrease layers in this weird way is so that players enter a normal looking room, but their available moving space will decrease as the snow melts.
1
Kwanatla
02/22/2019 1:22 am
Level 37 : Artisan Archer
I myself am new to the test for block, but I think it works across an area. I recommend minecraft.gamepedia.com
You can look all sorts of stuff up on there!
Good luck!
1

Welcome