8 ms·
Show HN: Teachcraft – Learn Python through Minecraft
- Rjevski 9y agoThis is really nice, however I wish someone makes an in-game version of this, so you don'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.
- lowpro 9y agoI was thinking about this as well, maybe something like ComputerCraft which uses Lua but build on top of it, try and make it more visual though.
- Confiks 9y agoLooks 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. To this end, I've been toying around a bit with an open source Minecraft clone called Minetest lately [1][2]. It's surprisingly complete, and could also have great uses in (programming) education. 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. The Lua language isn'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. Finally, I'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. Would anyone know more about how hard porting something like this would be? [1] https://github.com/minetest https://github.com/minetest [2] http://www.minetest.net http://www.minetest.net [3] https://github.com/minetest/minetest_game/blob/master/mods/flowers/init.lua https://github.com/minetest/minetest_game/blob/master/mods/f... [4] http://irrlicht.sourceforge.net/forum/viewtopic.php?f=2&t=51809&start=15 http://irrlicht.sourceforge.net/forum/viewtopic.php?f=2&t=51... [5] https://github.com/vvanders/wasm_lua https://github.com/vvanders/wasm_lua
- traverseda 9y agoAn open source project of mine, pycraft, has recently gotten some renewed attention. We learned that we were doing rendering very inefficiently, using "static" when we should have done stream. Our big project right now is making it easier for contributors to contribute. https://github.com/traverseda/pycraft https://github.com/traverseda/pycraft
- Filligree 9y ago> We learned that we were doing rendering very inefficiently, using "static" when we should have done stream. Can you expand on this? Did you use 'static' for VBOs that were only used for one or two frames?
- traverseda 9y agoI can not. Graphics aren't my thing. All I can say was that there was quantifiable improvement. But that's the beauty of open source. If you'd like to investigate it yourself it's the first issue. Getting someone competent involved in the graphics subsystem is another priority ;p
- j_s 9y agohttps://github.com/traverseda/pycraft/issues/89 https://github.com/traverseda/pycraft/issues/89
- shakna 9y ago> One obstacle for schools to get started with this however, is buying all the Minecraft licenses. That depends. It can be, if your class sizes. However, last two schools I worked with simply bought a lab-worth of Raspberry Pis, and used that limited version of Minecraft.
- dmoo 9y agoRe Minetest this works with Python if you install the raspberryjammod from GitHub Also recently managed to get it running with @edu_blocks https://twitter.com/damianmooney/status/881158457671524353 https://twitter.com/damianmooney/status/881158457671524353 So in general you can do anything with Minetest that you can with the raspberryPi version of minecraft.
- navbaker 9y agoThe instructions say to install Python 2.7. Does this not support 3.x?
- purrcat259 9y agoIts not like the people who will learn off this still be writing 2.x code in 2020... right? :) /s
- offbyone 9y agoGetting 3.x to work with mcpi is actually super easy; the library works nearly out of the box, and the code is basically the same as far as I can tell.
- Macuyiko 9y agoNice! A while ago, I also worked on a Python <-> 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'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. 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'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. At one point, I also had a plan to expand this into a tutorial series but didn't really follow up on this due to a lack of time. I'd really like to do this some day, though. [1]: https://github.com/Macuyiko/minecraft-python https://github.com/Macuyiko/minecraft-python and video: https://www.youtube.com/watch?v=j4JfwS5hNlw https://www.youtube.com/watch?v=j4JfwS5hNlw
- Diederich 9y agoWow! I believe this is exactly what I've been looking for. One of my goals is to get my son, who is really into Minecraft, also interested in programming. The github project seems to be receiving updates too. If I end up making some reasonable progress on this, I might just contact you later on, if that's ok with you!
- Macuyiko 9y agoSure! At one point, some group of volunteers also created a spin off project with the aim of putting more focus on creating a whole web interface around the concept, but I think it's inactive now. I try to maintain this repo from time to time and to keep it as bare-bones as possible. At one point, I plan to experiment with ZipPy (https://github.com/securesystemslab/zippy https://github.com/securesystemslab/zippy) to see if that would be a viable option to get Python 3 support underway.
- SeanDav 9y agoWould love to try this out as my kids love Minecraft (when played at friend's houses) but: "Step 1 - Install Minecraft" I can't get Minecraft to work on my Windows laptop. Minecraft crashes after a few seconds with a Java error: "Java (tm) Platform Binary SE has stopped working" Tried searching for a cause and tried everything I could find. Perhaps someone here has some suggestions? EDIT: 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.
- didymospl 9y agoWell, I haven'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.
- cjdell 9y agoThis 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. Here'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: http://webblocks.uk/ http://webblocks.uk/
- kitd 9y agoThis is great. FYI, Minecraft Pi has this facility too. My daughter loves playing with it. https://www.raspberrypi.org/learning/getting-started-with-minecraft-pi/worksheet/ https://www.raspberrypi.org/learning/getting-started-with-mi...
- danso 9y agoMinor 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: https://developers.facebook.com/tools/debug/sharing/?q=https%3A%2F%2Fteachcraft.net%2F https://developers.facebook.com/tools/debug/sharing/?q=https... https://cards-dev.twitter.com/validator https://cards-dev.twitter.com/validator
- mathattack 9y agoNice! I was just looking for something similar to this for my minions. Looks like it assumes programming knowledge (beyond say Scratch) already, no?
- Hydraulix989 9y agoCheck out our latest project BlockSchool, we teach programming to kids using a Scratch like programming language in a Minecraft world. Happy to give you a demo!
- lowpro 9y agoI was thinking about this just yesterday, and wondering if python could be taught in game like ComputerCraft uses Lua, except for python. Maybe certain object/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? 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.
- openfuture 9y agoI've had the same idea for a while, it'd be amazing if someone made this sub-game in minetest!
- nikkidurkin 9y agoThis 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're interested, its https://codemakers.com.au https://codemakers.com.au). I've been looking for a solution for teaching the more advanced students who want to start using a 'real' language. I was initially looking at using Scriptcraft, but TeachCraft looks like another great option!
- Guyag 9y agoNeat - I'm in the process of making a similar system which will spit out Spigot plugins, with the aim of letting kids create some simple ones themselves and hopefully planting the seed for getting them interested in programming. As part of this I included a 'split screen' view showing the generated Java in addition to the normal block work area, though this is read-only. It's been more of a challenge than I thought it would be to design the blocks such that the end set isn't near enough a 1:1 mapping to Java - showing it to a non-technical friend of mine made it clear that my intuition was way off. Would be interested to hear how you approached this (if you don't mind). Also interesting that I didn't find your website when I was initially researching, though I did come across https://www.learntomod.com/ https://www.learntomod.com/ (and even that was hard to find). I suspect my base search term of "minecraft blockly" isn't the most common one used by the target market to find something for their kids though.
- laurentoget 9y agohttps://education.minecraft.net/faq/how-much-does-it-cost/ https://education.minecraft.net/faq/how-much-does-it-cost/ minecraft education is $5/year, with 'opportunities for volume licensing' 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.
- nikkidurkin 9y agoUnfortunately you need Minecraft for Mac/PC: Java Edition to use mods, so modding won't work on the education edition.
- laurentoget 9y agoThis is even worse than i thought then.
- mstjohn1974 9y agoI 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-fish 9y agoHow about a guide on proper usage of fork, knife and spoon by teaching how to juggle with them?
- rb808 9y agoKids around here mostly use Minecraft PE on tablets. I know previously this didn't work with shared servers but maybe it does now - I'm not really up to date. Would these Python customized servers work with tablet Minecraft now?
- throwawayjava 9y agoThis is really great. All the existing "program in minecraft" solutions were pretty hacky IMO; lots of cruft to work around, which is really bad for my target audience of middle school students.
- ericfrederich 9y agoFront page has example code of a busyloop with a time.sleep. Not a stellar example of coding.
- ghostbrainalpha 9y agoWhat is wrong with that? Will it eat up RAM or crash the box if it was left to run for too long?
- travbrack 9y agoAny parents here have any success inspiring their child to code who was averse to it? I've tried scratch, tynker, roblox, etc without much luck.
- nerdponx 9y agoDon't force them to learn to code?
- Aqua 9y agoMaybe you are expecting just too much out of your child, if you tried so many options and they still don't like it, perhaps it is not something for them. Not everyone must like coding, let your kids shape their future based on their own passion instead of forcing yours upon them.
- travbrack 9y agoI guess I gave the impression that I'm shoving it down his throat. I'm taking the approach where I'm trying to inspire by showing him different kid friendly coding tools, not forcing anything and being totally okay if he doesn't want to do it. I was just curious if anyone had any success at inspiring a child to be excited by coding who wasn't into it at first. I know there are a lot of parents out there who try to force activities on their child, and I'm not one of them.
- Hydraulix989 9y agoHave you taken a look at BlockSchool yet? Our students love it because it is similar to Minecraft!
- soulnothing 9y agoI 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. Seeing stuff like this is really cool. Adding more to the community and growing opportunity.