SmylerMC / litemapy

Litemapy's goal is to provide an easy to use way to read and edit Litematica's schematic file format
GNU General Public License v3.0
51 stars 5 forks source link

Is there any way to change a block's properties? #9

Closed nouni19 closed 2 years ago

nouni19 commented 2 years ago

Is there any function or argument to the class BlockState to change the properties of the block? (Example, which direction a stair or a redstone torch is facing, note in a noteblock...)

SmylerMC commented 2 years ago

Hello, The BlockState constructor can take a str => str dictionary as argument to specify properties. For an existing object, those properties can be queried using the bracket syntax.

state = BlockState("minecraft:note_block", properties={"note": "10"})
note = state["note"]
# note now equals "10"