TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Teachcraft – Learn Python through Minecraft

212 pointsby emethalmost 8 years ago

20 comments

Confiksalmost 8 years ago
Looks like a great guide to get started with coding with Minecraft. There have been some efforts over the years, but this looks really complete. One obstacle for schools to get started with this however, is buying all the Minecraft licenses.<p>To this end, I&#x27;ve been toying around a bit with an open source Minecraft clone called Minetest lately [1][2]. It&#x27;s surprisingly complete, and could also have great uses in (programming) education.<p>It has a C++ core based on the Irrlicht 3D engine, but many of the game mechanics are implemented in Lua. Modifications like the examples in Teachcraft can also be built in Lua. For example, this [3] is a mod to spread flowers and mushrooms around the map.<p>The Lua language isn&#x27;t used much currently in the education environment, which is mostly focused around Scratch, Python and sometimes Javascript. Then again, seeing different languages and noticing their similarities can be educational in itself.<p>Finally, I&#x27;ve been wondering how hard it would be to port something like Minetest to Emscripten. Irrlicht seems to be compatible already [4]. The non-JIT version of Lua is compatible as well [5]. Obstacles in Minetest that I can identify would be the heavy use of the filesystem, the use of UDP sockets and memory sharing between threads.<p>Would anyone know more about how hard porting something like this would be?<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;minetest" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;minetest</a><p>[2] <a href="http:&#x2F;&#x2F;www.minetest.net" rel="nofollow">http:&#x2F;&#x2F;www.minetest.net</a><p>[3] <a href="https:&#x2F;&#x2F;github.com&#x2F;minetest&#x2F;minetest_game&#x2F;blob&#x2F;master&#x2F;mods&#x2F;flowers&#x2F;init.lua" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;minetest&#x2F;minetest_game&#x2F;blob&#x2F;master&#x2F;mods&#x2F;f...</a><p>[4] <a href="http:&#x2F;&#x2F;irrlicht.sourceforge.net&#x2F;forum&#x2F;viewtopic.php?f=2&amp;t=51809&amp;start=15" rel="nofollow">http:&#x2F;&#x2F;irrlicht.sourceforge.net&#x2F;forum&#x2F;viewtopic.php?f=2&amp;t=51...</a><p>[5] <a href="https:&#x2F;&#x2F;github.com&#x2F;vvanders&#x2F;wasm_lua" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;vvanders&#x2F;wasm_lua</a>
评论 #14855643 未加载
评论 #14855629 未加载
评论 #14856293 未加载
评论 #14855273 未加载
评论 #14857179 未加载
评论 #14859433 未加载
评论 #14855709 未加载
评论 #14862434 未加载
评论 #14855409 未加载
评论 #14856527 未加载
Macuyikoalmost 8 years ago
Nice! A while ago, I also worked on a Python &lt;-&gt; Minecraft interaction which is not based on mcpi (and RaspberryJuice), but instead spawns a full Jython based Python interpreter session server-side allowing you to directly use the full Bukkit API [1]. This allows to use various commands mcpi doesn&#x27;t support, such as creating lightning, explosions, and dynamically writing events using Python, either by using a client (sending Python code over the wire) or from the chat console in Minecraft.<p>The way how mcpi works is by creating a network bridge between the RaspberryJuice plugin and Python. Commands in Python are send to the Minecraft plugin over the wire and handled there (using the Bukkit API), with output send back to the Python client. This is safer in the sense that you don&#x27;t have the full Python environment running on the server and that (in theory) you can use both Python 2 and 3 (Jython support for Python 3 is not there yet). The drawback is that you can only utilize commands that are manually implemented and that the full Bukkit API is not directly exposed.<p>At one point, I also had a plan to expand this into a tutorial series but didn&#x27;t really follow up on this due to a lack of time. I&#x27;d really like to do this some day, though.<p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;Macuyiko&#x2F;minecraft-python" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Macuyiko&#x2F;minecraft-python</a> and video: <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=j4JfwS5hNlw" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=j4JfwS5hNlw</a>
评论 #14858437 未加载
lowproalmost 8 years ago
I was thinking about this just yesterday, and wondering if python could be taught <i>in game</i> like ComputerCraft uses Lua, except for python.<p>Maybe certain object&#x2F;data types could have a physical presence like a database could be a shelf, and hooking them up physically would create a real database will multiple tables that could be interacted with in the game. I was thinking about this more in the sense of actually helping me model applications instead of teaching, as it would just be more fun to work with. Does anyone else have interest?<p>Another way of thinking about this could be like a library with bookshelves in game that you can actually walk though, and program an in game robot to get certain books when you want certain things (querying), and it could help visualize how a database and application were set up and working together.
评论 #14856339 未加载
soulnothingalmost 8 years ago
I remember working with a few people who had families several years back.There was a bring your kid to work day. Around mid day I saw all the kids playing minecraft on their laptops. They were probably about 8 - 12 I think. As I talked to them, they got really excited. Wanting to show off their private worlds. They had created custom modules in java, were running servers, and all these other things. This was like the lego blocks for their generation. In addition it bought a lot of STEM knowledge to boot.<p>Seeing stuff like this is really cool. Adding more to the community and growing opportunity.
Rjevskialmost 8 years ago
This is really nice, however I wish someone makes an in-game version of this, so you don&#x27;t even have to get a development environment running - just install the mod (which kids are already familiar with), jump in game and develop there.
评论 #14858537 未加载
nikkidurkinalmost 8 years ago
This looks great! I run after-school coding lessons for Australian kids aged 8-12, teaching them to code Minecraft mods using scratch-like code blocks (if you&#x27;re interested, its <a href="https:&#x2F;&#x2F;codemakers.com.au" rel="nofollow">https:&#x2F;&#x2F;codemakers.com.au</a>).<p>I&#x27;ve been looking for a solution for teaching the more advanced students who want to start using a &#x27;real&#x27; language. I was initially looking at using Scriptcraft, but TeachCraft looks like another great option!
评论 #14857966 未加载
cjdellalmost 8 years ago
This looks awesome. Minecraft is a fantastic way to teach programming, and not just to kids! There is something magical about seeing code you write doing something visual that you can interact with.<p>Here&#x27;s a shameless link to a thing I created a while back when I was running workshops. Minecraft-like world that runs in pure browser aimed at teaching JavaScript:<p><a href="http:&#x2F;&#x2F;webblocks.uk&#x2F;" rel="nofollow">http:&#x2F;&#x2F;webblocks.uk&#x2F;</a>
travbrackalmost 8 years ago
Any parents here have any success inspiring their child to code who was averse to it? I&#x27;ve tried scratch, tynker, roblox, etc without much luck.
评论 #14859544 未加载
评论 #14859415 未加载
评论 #14859385 未加载
评论 #14862468 未加载
rb808almost 8 years ago
Kids around here mostly use Minecraft PE on tablets. I know previously this didn&#x27;t work with shared servers but maybe it does now - I&#x27;m not really up to date.<p>Would these Python customized servers work with tablet Minecraft now?
SeanDavalmost 8 years ago
Would love to try this out as my kids love Minecraft (when played at friend&#x27;s houses) but:<p>&quot;Step 1 - Install Minecraft&quot;<p>I can&#x27;t get Minecraft to work on my Windows laptop. Minecraft crashes after a few seconds with a Java error:<p>&quot;Java (tm) Platform Binary SE has stopped working&quot;<p>Tried searching for a cause and tried everything I could find. Perhaps someone here has some suggestions?<p><i>EDIT:</i> Re downvotes: that will teach me to post a half finished piece while I went to check on actual Java error! Not complaining - my fault entirely for posting half-assed reply which sounded aggressive.
dansoalmost 8 years ago
Minor meta note: this site has almost no HTML metadata, which is probably not great for SEO but also makes it less visible when sharing on social media:<p><a href="https:&#x2F;&#x2F;developers.facebook.com&#x2F;tools&#x2F;debug&#x2F;sharing&#x2F;?q=https%3A%2F%2Fteachcraft.net%2F" rel="nofollow">https:&#x2F;&#x2F;developers.facebook.com&#x2F;tools&#x2F;debug&#x2F;sharing&#x2F;?q=https...</a><p><a href="https:&#x2F;&#x2F;cards-dev.twitter.com&#x2F;validator" rel="nofollow">https:&#x2F;&#x2F;cards-dev.twitter.com&#x2F;validator</a>
laurentogetalmost 8 years ago
<a href="https:&#x2F;&#x2F;education.minecraft.net&#x2F;faq&#x2F;how-much-does-it-cost&#x2F;" rel="nofollow">https:&#x2F;&#x2F;education.minecraft.net&#x2F;faq&#x2F;how-much-does-it-cost&#x2F;</a><p>minecraft education is $5&#x2F;year, with &#x27;opportunities for volume licensing&#x27; which sounds affordable, but then it feels really misguided for microsoft not to give it away for free. Getting future developers to have some contact with the microsoft ecosystem is worth more than $5 i would think.
评论 #14856967 未加载
didymosplalmost 8 years ago
Well, I haven&#x27;t played Minecraft since around 2013, but this tutorial so entertaining that I will probably install it again as soon as I get back from work today. This reminds me of the great game called Colobot, where players could program their robots to gather resources, fight the enemies etc using Java-like language. It would be nice to have a simple API to script NPC in Minecraft too.
kitdalmost 8 years ago
This is great.<p>FYI, Minecraft Pi has this facility too. My daughter loves playing with it.<p><a href="https:&#x2F;&#x2F;www.raspberrypi.org&#x2F;learning&#x2F;getting-started-with-minecraft-pi&#x2F;worksheet&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.raspberrypi.org&#x2F;learning&#x2F;getting-started-with-mi...</a>
throwawayjavaalmost 8 years ago
This is really great. All the existing &quot;program in minecraft&quot; solutions were pretty hacky IMO; lots of cruft to work around, which is really bad for my target audience of middle school students.
mathattackalmost 8 years ago
Nice! I was just looking for something similar to this for my minions. Looks like it assumes programming knowledge (beyond say Scratch) already, no?
评论 #14862427 未加载
mstjohn1974almost 8 years ago
I think that is great...I wish there would be more like that out there so kids and adults can learn playing a programming language
blubb-fishalmost 8 years ago
How about a guide on proper usage of fork, knife and spoon by teaching how to juggle with them?
ericfrederichalmost 8 years ago
Front page has example code of a busyloop with a time.sleep.<p>Not a stellar example of coding.
评论 #14859575 未加载
navbakeralmost 8 years ago
The instructions say to install Python 2.7. Does this not support 3.x?
评论 #14855322 未加载