Created
November 20, 2016 04:04
-
-
Save benjjo/5b4042367c81e392a56d409ba82925e1 to your computer and use it in GitHub Desktop.
Minecraft Pi compass. Designed to indicate NORTH with a red block and SOUTH with a black block.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3.4 | |
#-------------------------------------------------------------------------- | |
# Name: A simple compass for Minecraft Pi | |
# Purpose: Designed to indicate NORTH with a red block and SOUTH with | |
# a black block. | |
# Author: benjo charlie | |
# Created: 2016 | |
#-------------------------------------------------------------------------- | |
# Import libraries and set up the globals | |
import mcpi.minecraft as minecraft | |
mc = minecraft.Minecraft.create() | |
x, y, z = mc.player.getPos() | |
# Use an Obsidian black block for South. | |
mc.setBlock(x, y, z-1, 49) | |
#Use a Glowing Obsidian red block for North. | |
mc.setBlock(x, y, z-2, 246) | |
mc.postToChat("Try not. Do, or do not. There is no try.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment