# How to use Python to make a door or bed in Minecraft? [closed]

I have been using a readable CSV file and a bit of code to generate a fort, but then not a single one of my beds, doors or ladders appeared. Only the back half of my beds actually appeared. For a test I used setBlock() to make a bed but again only the back half appeared. How do I make Python realise I want to make it cover 2 blocks?

• I realize this is a really old topic. However, with all respect to techraf, Milliways, Steve Robillard, and Jacobmoo1, this question deals with an API for a version of minecraft ONLY avaiable on the Raspberry Pi. – Thorin Schmidt May 10 '18 at 13:05

Just as in vanilla Minecraft, you need to set two blocks to be a bed for this to work.

The vanilla commands would be:

/setblock 0 64 0 bed 0
/setblock 0 64 1 bed 8


(for a bed facing north)

You should do something similar in your Minecraft Pi Python code:

mc.setBlock(x, y, z, 26, 0)
mc.setBlock(x, y, z + 1, 26, 8)


Remember the API for setBlock is setBlock(x,y,z,id,[data]). The explanation for the data code is available at the Gamepedia wiki:

The door operates similarly, but with block ID 64 instead, and you'll need to modify the y (up/down axis, with positive being up) instead of the z (north/south axis, with positive being south).
• @user75085 Did you set use the exact example I gave, including the 0 and 8? That is how you tell the game that one half is the bottom end and one is the top end. – Aurora0001 Oct 22 '17 at 8:38