Jump to content

Wikijunior:Raspberry Pi/Minecraft Christmas Tree Decorations

From Wikibooks, open books for an open world

by Andrew Oakley andrew@aoakley.com for Cotswold Jam

http://cotswoldjam.org

Public Domain 2018-11

You need a world with trees

[edit | edit source]

To load/reset a snowy woodland world in Minecraft:

cp minecraft-snow-trees-flat.tgz ~/
cd
tar xvzf minecraft-snow-trees-flat.tgz
cd -

Run the program and play with it!

[edit | edit source]

The makestar1.py and makestar2.py programs create a Christmas star in a 3×3×3 block (think of a Rubik's Cube – 3 blocks wide, 3 high, 3 long). The star will be placed a few blocks north of the player.

Try editing the block IDs and wool status colours to make your own designs!

To put stars on the top of all nearby trees, uncomment the last line: ("uncomment" means remove the # at the start of the line)

xmastrees.find_trees(mc,playerx,playery,playerz,10,2,makestar)

Note that it can take several minutes to find all nearby trees.

WOOL status colours

[edit | edit source]
CodeColourCodeColour
00White08Light grey
01Orange09Cyan
02Magenta10Purple
03Light Blue11Blue
04Yellow12Brown
05Lime13Green
06Pink14Red
07Grey15Black

Advanced topics

[edit | edit source]

Finished making stars? Try making a star out of WOOD and see how that causes the find_trees program to go horribly wrong!!! Why does making a star out of WOOD or CACTUS cause find_trees to go wrong?