TeachPythonWithMinecraft
Teaching Python programming and concepts using the Python Minecraft API for the Raspberry Pi version of Minecraft.
Install / Use
/learn @Jflick58/TeachPythonWithMinecraftREADME
TeachPythonWithMinecraft
Teaching Python programming and concepts using the Python Minecraft API for the Raspberry Pi version of Minecraft.

Background
This is the repo for the Florin High School (Sacramento, CA) Python workshop at KPMG. In this workshop, you'll learn Python programming and programming concepts by writing methods to control in-game Minecraft activites, and then you will connect those actions to a Flask-based website to act as a controller. We distributed Rapsberry Pi to the students for them to take with them after the workshop. If you don't have a rapsberry pi, you can emulate one on any Mac, Windows or Linux computer by following the instructions in this link.
You'll learn:
- Basic version control with Github
- Python Virtual Environments
- Dependency Management
- Variables
- If Statements
- Loops
- Functions
- Backend Web Development concepts
All this culminating in a Flask-based Web controller for Minecraft Pi!
How to use this repo
-
Login to github with your account
-
Click the "Star" button in the upper right hand corner.
-
Click the "Fork" button
-
Wait while Github copies the repo to your account
-
Click the "Clone/Download" button and download the repo as a zip file to your machine
-
Unzip the repo. Open a command prompt and
CDto the location you extracted the repo to. -
Type
virtualenv venvand hit enter. -
Wait while the virtual environment is activated. Then, type
source venv/bin/activateand hit enter. -
You should see (venv) on the left side of your command prompt. Type
pip3 install -r requirements.txtand hit enter -
You are ready to start learning Python with Minecraft! Bonus: You finished your first lesson on version control, virtual environments, and dependency management! Good Job!
-
Follow the lessons in the Lessons Folder.
Useful Information
Create a script
Once the Pi has loaded and you are at the desktop screen, click on Menu then Programming and choose Python IDE3
Click file and select click script. To save, go to file then click save as.
We need to add an import for our script that will allow us to control Minecraft, type this code into the first line of your script
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
This import will need to be entered for every script you create
You can move to a new line in a script by pressing enter
A script can be run by pressing f5 or going to the run option on the top menu bar
Load Minecraft
Go to menu, go to games and click Minecraft. Bring this window alongside your Python script window so it is easier to use. You can move between the game and scripts by pressing the tab button.
In Minecraft click 'Create new world'. When this loads it will look something like the image below. Everyone’s will look different when it first loads.

Moving around the game
To move around the game, you can use the arrow keys and use the space button to jump.
Hints
Look out for Pete the pig. For some questions he'll give hints on how to do them.

What if something goes wrong ?
If you get an error saying 'Syntax error' double check you have typed everything correctly and try running your script again.
Targeted Curriculum
Key Stage 2
• Design, write and debug programs that accomplish specific goals, including controlling or simulating physical systems; solve problems by decomposing them into smaller parts.
• Use sequence, selection, and repetition in programs; work with variables and various forms of input and output.
Key Stage 3
• Use 2 or more programming languages, at least one of which is textual, to solve a variety of computational problems; make appropriate use of data structures, design and develop modular programs that use procedures or functions.
Useful Block ID's
|Block |ID | Picture | Block |ID | Picture
| ------------- |:-------------:|:-----:|:--------:|:---------:|------:|
| Air | 0 | |Wood Planks|5|
| Stone | 1 |
|Bedrock|7|
| Grass | 2 |
|Sand|12|
|Dirt | 3|
|Gravel|13|
|Cobblestone| 4|
|Glass|20|
|Leaves|18|
|Lava|11|
|Water|9|
Credits
- Github user jeremycook94 for creating most of the lesson plans.
- EV Computing for the readme image.
- The Raspberry Pi Foundation for their work on Rapsberry Pi, and the Raspbian image that contains the Python and Minecraft distributions used in this workshop.
- KPMG cowowrkers Matt Kwong, Andrew Suarez-Lopez, and Frank Wright
Related Skills
claude-opus-4-5-migration
106.4kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
model-usage
345.9kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
TrendRadar
50.6k⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts.🎯 告别信息过载,你的 AI 舆情监控助手与热点筛选工具!聚合多平台热点 + RSS 订阅,支持关键词精准筛选。AI 智能筛选新闻 + AI 翻译 + AI 分析简报直推手机,也支持接入 MCP 架构,赋能 AI 自然语言对话分析、情感洞察与趋势预测等。支持 Docker ,数据本地/云端自持。集成微信/飞书/钉钉/Telegram/邮件/ntfy/bark/slack 等渠道智能推送。
mcp-for-beginners
15.8kThis open-source curriculum introduces the fundamentals of Model Context Protocol (MCP) through real-world, cross-language examples in .NET, Java, TypeScript, JavaScript, Rust and Python. Designed for developers, it focuses on practical techniques for building modular, scalable, and secure AI workflows from session setup to service orchestration.
