Build Minecraft World with Python Code
No cost for server and game subscription
Interactive
Less Internet Bandwidth
Simple Coding Skill
Minecraft is a sandbox game, where you build structures, collect items, mine minerals and fight monsters in order to survive, but this session is not about using Minecraft to build anything in the normal Minecraft way. It is about Minecraft as a final product from coding/programming. By programming Minecraft, you make your gaming experiences even more exciting, creative, and individual. As you play the normal game, you follow the basic rules of the Minecraft game as set out by the game designers. By writing programs that interact with the Minecraft game world, you can make complex and repetitive tasks—like building huge streets of houses, rows of may trees and large structures, etc. automatically. You can make the game and the objects inside it behave in new ways, and invent new things that even the original creators of the game didn’t think of. But most of all, you will learn a general skill—how to program using the Python programming language. You will then be able to apply this to all sorts of other things, not just Minecraft.
Dr. Piyarat Khanthap
(Puk) Technology Director and MYP Design KIS International School, Bangkok [email protected] |
Acting Sub Lt. Sittiporn Nualchawee
(Tum) ICT Manager KIS International School, Bangkok [email protected] |
Discovery Session
Discover how Math skills (Coordinates and Area/Geometry) integrate with Python programming which is interactive with Minecraft. Grade 8 students learn how to build things on Minecraft by using Python programming language. They design an island landscape with some specific parameters that require Math and programming skills to solve a problem.
Deep Dive
Install all required software on your computer.
https://klearning.ict.kis.ac.th/DeepLearning2015/
Minecraft Demo Account:
Username: [email protected]
Password: python201415
Instruction & Steps for installation
Install all required software on your computer.
https://klearning.ict.kis.ac.th/DeepLearning2015/
Minecraft Demo Account:
Username: [email protected]
Password: python201415
Instruction & Steps for installation
Challenges & Takeaway
Level 1 - no background in Minecraft and Python
- Download and install Minecraft. Explore how to normally build things on Minecraft world.
Level 2: Basic Minecraft but no Python background
- Practice simple code of Python and see how it displays and interacts with Minecraft
Level 3: Basic Minecraft and Python
- Adjust a few details of Python code on student's work and see effect(s) on your Minecraft
Code to try
import mcpi.minecraft as minecraft
import mcpi.minecraftstuff as minecraftstuff
mc = minecraft.Minecraft.create()
mcdrawing = minecraftstuff.MinecraftDrawing(mc)
pos=mc.player.getPos()
#clear space
airBlock=0
mc.setBlocks(pos.x,pos.y,pos.z,pos.x+90,pos.y+10,pos.z+10,airBlock)
#tree
leafBlock=18
radius=10
mcdrawing.drawSphere(pos.x,pos.y+radius+10,pos.z,radius,
leafBlock)
woodBlock=17
mc.setBlocks(pos.x,pos.y,pos.z,pos.x+1,pos.y+10,pos.z+1,
woodBlock)
#trees
leafBlock=18
woodBlock=17
radius=10
pos=mc.player.getPos()
'''mcdrawing.drawSphere(pos.x,pos.y+radius+10,pos.z,radius, leafBlock)
mc.setBlocks(pos.x,pos.y,pos.z,pos.x+1,pos.y+10,pos.z+1, woodBlock)'''
mcdrawing.drawSphere(pos.x+20,pos.y+radius+10,pos.z,radius, leafBlock)
mc.setBlocks(pos.x+20,pos.y,pos.z,pos.x+20,pos.y+10,pos.z+1, woodBlock)
mcdrawing.drawSphere(pos.x+40,pos.y+radius+10,pos.z,radius, leafBlock)
mc.setBlocks(pos.x+40,pos.y,pos.z,pos.x+40,pos.y+10,pos.z+1, woodBlock)
mcdrawing.drawSphere(pos.x+60,pos.y+radius+10,pos.z,radius, leafBlock)
mc.setBlocks(pos.x+60,pos.y,pos.z,pos.x+60,pos.y+10,pos.z+1, woodBlock)
mcdrawing.drawSphere(pos.x+80,pos.y+radius+10,pos.z,radius, leafBlock)
mc.setBlocks(pos.x+80,pos.y,pos.z,pos.x+80,pos.y+10,pos.z+1, woodBlock)
#house
stoneBlock=1
pos=mc.player.getPos()
mc.setBlocks(pos.x,pos.y,pos.z,pos.x+10,pos.y+10,pos.z+10,stoneBlock)
airBlock=0
mc.setBlocks(pos.x+1,pos.y,pos.z+1,pos.x+9,pos.y+9,pos.z+9,airBlock)
mc.setBlocks(pos.x,pos.y+1,pos.z+5,pos.x+1,pos.y,pos.z+5,airBlock)
glassBlock=20
mc.setBlocks(pos.x,pos.y+8,pos.z+2,pos.x,pos.y+6,pos.z+8,glassBlock)
mc.setBlocks(pos.x,pos.y+4,pos.z+1,pos.x,pos.y+2,pos.z+3,glassBlock)
mc.setBlocks(pos.x,pos.y+4,pos.z+9,pos.x,pos.y+2,pos.z+7,glassBlock)
import mcpi.minecraftstuff as minecraftstuff
mc = minecraft.Minecraft.create()
mcdrawing = minecraftstuff.MinecraftDrawing(mc)
pos=mc.player.getPos()
#clear space
airBlock=0
mc.setBlocks(pos.x,pos.y,pos.z,pos.x+90,pos.y+10,pos.z+10,airBlock)
#tree
leafBlock=18
radius=10
mcdrawing.drawSphere(pos.x,pos.y+radius+10,pos.z,radius,
leafBlock)
woodBlock=17
mc.setBlocks(pos.x,pos.y,pos.z,pos.x+1,pos.y+10,pos.z+1,
woodBlock)
#trees
leafBlock=18
woodBlock=17
radius=10
pos=mc.player.getPos()
'''mcdrawing.drawSphere(pos.x,pos.y+radius+10,pos.z,radius, leafBlock)
mc.setBlocks(pos.x,pos.y,pos.z,pos.x+1,pos.y+10,pos.z+1, woodBlock)'''
mcdrawing.drawSphere(pos.x+20,pos.y+radius+10,pos.z,radius, leafBlock)
mc.setBlocks(pos.x+20,pos.y,pos.z,pos.x+20,pos.y+10,pos.z+1, woodBlock)
mcdrawing.drawSphere(pos.x+40,pos.y+radius+10,pos.z,radius, leafBlock)
mc.setBlocks(pos.x+40,pos.y,pos.z,pos.x+40,pos.y+10,pos.z+1, woodBlock)
mcdrawing.drawSphere(pos.x+60,pos.y+radius+10,pos.z,radius, leafBlock)
mc.setBlocks(pos.x+60,pos.y,pos.z,pos.x+60,pos.y+10,pos.z+1, woodBlock)
mcdrawing.drawSphere(pos.x+80,pos.y+radius+10,pos.z,radius, leafBlock)
mc.setBlocks(pos.x+80,pos.y,pos.z,pos.x+80,pos.y+10,pos.z+1, woodBlock)
#house
stoneBlock=1
pos=mc.player.getPos()
mc.setBlocks(pos.x,pos.y,pos.z,pos.x+10,pos.y+10,pos.z+10,stoneBlock)
airBlock=0
mc.setBlocks(pos.x+1,pos.y,pos.z+1,pos.x+9,pos.y+9,pos.z+9,airBlock)
mc.setBlocks(pos.x,pos.y+1,pos.z+5,pos.x+1,pos.y,pos.z+5,airBlock)
glassBlock=20
mc.setBlocks(pos.x,pos.y+8,pos.z+2,pos.x,pos.y+6,pos.z+8,glassBlock)
mc.setBlocks(pos.x,pos.y+4,pos.z+1,pos.x,pos.y+2,pos.z+3,glassBlock)
mc.setBlocks(pos.x,pos.y+4,pos.z+9,pos.x,pos.y+2,pos.z+7,glassBlock)