๐๏ธ tryashtar ยท 12 points ยท Posted at 23:42:36 on November 23, 2015 ยท (Permalink)*
This command would let you change or test for the state of a block. This would be very, very helpful in many cases. I imagine the syntax would probably be something like this:
/blockstate <check|set> <x> <y> <z> <state>
Basically, you would specify whether to SET the blockstate to match your last argument or CHECK whether the blockstate matches (ie. "Block matches block state", "Block does not match block state").
Here's some example uses:
/blockstate set ~ ~-1 ~ {color=brown}
/blockstate check ~ ~ ~ {power=15,north=side}
/blockstate check 0 50 -32 {half=top}
What are the conditions for command success?
CHECK
Succeeds whenever the block checked possesses all the states specified with the given values. Ignores unspecified states.
Fails when the block does not possess a given state. (example: /blockstate check ~ ~ ~ {color=green} on dirt)
SET
Succeeds whenever all states specified are valid states for that block and all values specified are valid values for that state.
Succeeds even if the block already possesses every state. (example: /blockstate set ~ ~ ~ {level=3} on a full cauldron)
Fails when the block does not possess a given state. (example: /blockstate set ~ ~ ~ {variant=podzol} on wooden planks)
Fails when a value does not exist for a state. (example: /blockstate set ~ ~ ~ {color=asparagus} on wool)
A failed command will NEVER update the block, even if some states are valid. (example: /blockstate set ~ ~ ~ {power=7,axis=z} on redstone dust)
Block states are completely inaccessible via commands at the moment. In the future, stuff like /testforblock and /fill will probably use block states instead of damage values. Both now and if or when this does happen, this type of command would still be very useful and strengthen the relationship between block states and commands.
Thanks for reading! <3
bitKoder ยท 3 points ยท Posted at 00:37:16 on November 24, 2015 ยท (Permalink)
I fully support this idea. It's simple, straightforward and packed with potential. Upvoted!
mrlemonofbanana ยท 2 points ยท Posted at 13:56:27 on November 25, 2015 ยท (Permalink)
Block states in commands are coming in 1.10 according to /u/_grum: https://www.reddit.com/r/Minecraft/comments/3qb5zr/add_block_states_commands/
๐๏ธ tryashtar ยท 1 points ยท Posted at 17:44:40 on November 25, 2015 ยท (Permalink)
Oh, that's awesome! Thanks for showing me that!
elyisgreat ยท 1 points ยท Posted at 16:29:41 on November 24, 2015 ยท (Permalink)
I think they should integrate block states into the current system in place of the
damageparameter and not add a separate command.๐๏ธ tryashtar ยท 1 points ยท Posted at 18:05:13 on November 24, 2015 ยท (Permalink)
I agree, but this should still be in place to set block state without modifying tile entity data, unless setblock is changed to support that.
elyisgreat ยท 1 points ยท Posted at 19:05:09 on November 24, 2015 ยท (Permalink)
To be honest, this is a concern only for tile entities. I don't think it warrants its own command. Personally, I think it makes more sense for tile entities to have a
blockstatedata tag, and then it can be modified via the/blockdatacommand.mrlemonofbanana ยท 1 points ยท Posted at 13:54:22 on November 25, 2015 ยท (Permalink)
Setblock will do block states in 1.10, confirmed by /u/_grum
mathe172 ยท 1 points ยท Posted at 18:59:23 on November 24, 2015 ยท (Permalink)
The things that would be possible (color, orientation...) are already possible with
/testforblock,/setblockand/blockdata(the only thing that is not really possible is changing the metadata while preserving NBT), the rest is even theoretically impossible. The orientation of redstone for example isn't stored anywhere, it's simpy given by the surrounding blocks, meaning the block state is not something that can be manipulated๐๏ธ tryashtar ยท 1 points ยท Posted at 22:17:00 on November 24, 2015 ยท (Permalink)
I suppose you're right. Once blockstate checks and sets are built into those commands, it would really be obsolete.
I do wish there was a way to change state without trashing tile entity data, though. :(
roblitzmanguy ยท 1 points ยท Posted at 18:05:14 on November 27, 2015 ยท (Permalink)
Now we should have asparagus colored wool /s
Whatever, this is great, like for the "acacianator boots" and the "icestayer"