block names for python notebooks
My students are using python notebooks to create buildings. A student today asked me how he could give his agent spruce planks. I can't seem to work out how to do this.
This code works to give oak planks...
agent.give("planks", 64, 2)
/give @p planks 64 1
The 1 on the end specifies the type of plank (spruce), but the python functions don't accept this extra argument.
Alternatively I thought we might use the block id (see link below) but I can't see a way to do this in python notebooks.
https://educommunity.minecraft.net/hc/en-us/community/posts/360072467772-item-block-id-for-reference
Any ideas?
-
I worked this out. If anyone else needs to know I found this comment in the agent.py file in C:\Program Files (x86)\Microsoft Studios\Minecraft Education Edition\data\python\minecraft_builtins.zip
To give a block with a non-zero data value, pass a tuple with (name, data_value, components).I don't know what the components are, but I just gave it an empty string and it worked... here is the code I used:agent.give(("planks", 1, ""), 64, 2)
2 -
I cannot tell you how much time I have spent trying to find this!!! Nicholas Stebbing You are a superhero!!!!
Yippee!!!!!!!!!!!!!!!!!!!!! This changes about 100 of my coding projects!!!!! =] Yippee!!!!!!!!!!!!!
1 -
amazing!!!! great job
0
Please sign in to leave a comment.
Comments
3 comments