Skip to content

Instantly share code, notes, and snippets.

@manchoz
Created May 9, 2017 10:12
Show Gist options
  • Save manchoz/ad189b9c45e4224354326d595e32c2c6 to your computer and use it in GitHub Desktop.
Save manchoz/ad189b9c45e4224354326d595e32c2c6 to your computer and use it in GitHub Desktop.
from mcpi.minecraft import Minecraft
from gpiozero import DigitalInputDevice
from time import sleep
mc = Minecraft.create()
mc.postToChat("Micromine bitcraft")
pin0 = DigitalInputDevice(17)
while True:
sleep(0.1)
pos = mc.player.getPos()
if pin0.value == 1:
pos.y = pos.y + 0.5
mc.player.setPos(pos)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment