神刀安全网

TeachCraft – Learning Python Through Minecraft

TeachCraft

A series of lessons used to teach middle school and high school kids the fundamentals of programming!

Using Python, each of the lessons will teach the kids new concepts, going through while loops, if statements, for loops, algorithms, function calls, and the like.

The entire process is collaborative – students are able to see each other’s progress as they are all in the same multiplayer server together. Indeed, one of the later lessons constructs a magical system the students can use to battle each other, invoking spells they prepared in code!

All that is needed to get started is downloading the code in this repo and installing java on your system (full instructions in thesetup guide).

I have a server up and running with the python api open – all the lessons default to pointing to my server’s IP. If you’d like privacy, or if my server is down due to being DOS’ed (easily achievable through it’s open python api), you may want to setup your own server . If you note my server is done, feel free to open an issue here to inform me to restart it.

Lessons & Setup

Initial Setup: Get minecraft running, get connected to the server.

Lesson 1: Teleport your character to a point you define in code.

Lesson 2: Make a path of something (flowers, lava, fire) follow behind you while you walk.

Lesson 3: Give your character the ability to walk on water (by turning water below your character into ice).

Lesson 4: Create a building programmatically

Lesson 5: Create a pyramid programmatically

Lesson 6: Use an algorithm to construct the pyramid by analyzing the pattern you discovered in lesson 5!

Lesson 7: Create a magic system that listens to Minecraft chat, and executes your pre-defined spells!

(Advanced) Lesson 8: Learn how to import an image into minecraft pixel art using Python Imaging Library.

Want to host your own server / run a server locally?

  • You want to switch tothis repo

Minecraft Docs

  • pi version Has most of the basics of the python api
  • our version Has the additional things our python api supports, above and beyond the pi version
  • Minecraft block ids

Notes

  • Player location from the python api will not match the same retrieved from the server. This is because raspberryjuice calculates it from the spawn point, while the server calculates it from 0,0,0. To fix, run this as an admin: setworldspawn 0 0 0

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » TeachCraft – Learning Python Through Minecraft

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址