Minecraft

Minecraft is brilliant, and the Pi edition doubly so, its free and the API is absolutely genius, allowing you to alter the world in real-time.  I have used the api to create a load of cools things, from a real-time clock to an operational cannon.
Install
Minecraft - Install - how to install Minecraft: Pi edition on you Raspberry Pi

Minecraft, Canarymod & RaspberryJuice - using Canarymod and RaspberryJuice to run Minecraft Pi programs on the full version of Minecraft

Using the API
API Tutorial - an in-depth view into Minecraft, the concepts, the API and how to program it, great for beginners

API - The basics - an introduction into the Minecraft API, its functions and how to use it, great for those who already understand Minecraft & have some experience of programming

Python API Reference - a detailed description and reference of the api python library - it documents all the functions available and gives example of how to use the library

MinecraftStuff Extensions - I have started an extension library for the API to deliver simple functions, currently there is a drawing class for creating shapes and lines.

Minecraft Graphics Turtle - a 3d graphics turtle for minecraft, program it using command like forward, left, right, up, down, penup, pendown, etc

Other resources
If you looking for more learning resources on Minecraft: Pi edition, check out:

blog.whaleygeek.co.uk/minecraft-pi-with-python/ for some amazing flashcards

arghbox.wordpress.com for really comprehensive teaching resources

My Projects
Examples of what I have done with Minecraft: Pi Edition and its API

Hide and Seek - a really simple game of hide and seek for Minecraft

Auto Bridge - an absolutely brilliant utility (even if I say so myself) which automatically creates a bridge in front of you, no more falling off cliffs, no more having to swim across oceans, the auto bridge allows you to walk straight on

Massive Analogue Clock - big enough so you can walk on the arms

Planetary Gravity Simulator - a whole solar system simulated in minecraft

Snake - the classic game, Snake, built using the Minecraft API

Create massive 3D models - render obj 3d model files into Minecraft

Take a stroll around New York - Manhattan Island rendered in Minecraft

Create 3d Models - version 2 - an update to my 3d model to minecraft renderer, so it draw full polygons and has the ability to map materials in the model to blocks in minecraft

Cannon - a fully working cannon, lets blow stuff up!

Turning blocks into Bombs - an example of how to capture player block hits, when the player hits a block, it flashes for a few seconds then explodes destroying all the blocks around it

Piano - hitting certain blocks to make piano notes, ever wanted to here Twinkle Twinkle Little Star played in Minecraft

Sound effects - I got bored of Minecraft: Pi Edition not having any sound effects, so I decided to make my own!  Footsteps, falling, screaming, jumping, etc

Making a Traffic Jam - a collection of programs which show how I went from creating a traffic light to simulating a traffic jam

Coding shapes - an example of how to use my MinecraftStuff api extensions to create shapes and lines

Music Music Visualiser - an old 'graphic equaliser' in Minecraft.


Minecraft Graphics Turtle - like drawing turtle's you see in most languages but this ones 3d in Minecraft.  Check out the 3d fractal tree's I created using the turtle.

46 comments:

  1. i know its probbley realy hard buthow would you get mobs they dont have to do anything just like a chicken walkng around or somthing like that

    ReplyDelete
    Replies
    1. Hi I haven't tested it out, but if you have minecraft pocket edition the file types for the worlds are the same kinds of files, so you can replace the raspberry pi entities with the pocket edition entities. I think this will work because it works with chunks which controlls the landscape.

      Delete
    2. You probably use a MCPE world but my Minecraft Pi crashes every time I try

      Delete
    3. I made a python script to spawn some mobs on MCPI. Check this out : https://github.com/Will-777/spawn_mobs_mcpi

      Delete
  2. Dude. gpioRAP + Minecraft PI edition = Toggle gpio's whilst in the game. Create your own logic blocks turn on Gpios by blowing stuff up in minecraft. I know you can make it happin Captn. please post if you do.

    ReplyDelete
  3. I really want to actually make my own mob. I know this is probably really advanced but if I based it off an already existing animal like a pig could you point me in the right direction for how to do this?

    ReplyDelete
    Replies
    1. I would start with making a plugin for bukkit, its a minecraft server, the learning curve is much lower and it will teach you about how minecraft is structured and java. See http://wiki.bukkit.org/Plugin_Tutorial. Other than that google a tutorial have a go!

      Delete
  4. Martin, I've made WorldEdit for Minecraft Pi! It uses a GUI with buttons and stuff! Please reply!! -- I also made a CCTV and Chat plugin with a GUI too!

    ReplyDelete
    Replies
    1. Hi Samuel,

      Thanks for all the information about your programs, they sound great. Unfortunately I havent had time to look into them, I am absolutely stacked on a project, hence no posts in a while. I promise when I have more time, Ill look at it, like I said it sounds great.

      Mart

      Delete
    2. samuel can I have a copy?

      Delete
  5. hey martin guess what i found... minecraft pi edition SURVIVAL MODE!
    u can open chests and mine ores and xplode TNT. Oly dillema is u can only hurt mobs w tnt. You can make armor, cook food, and if u have a pocket edition world your using it w, then when it turns night u can sleep in a bed! Use a nether core reactor for once. It is boss. ill look for the link.

    ReplyDelete
  6. Minecraft-Pi Survival Mode | Jeff's Raspberry Pi Reference
    here it is, just dont do the commands and scroll to the bottom and just download it directly, and paste it into your mcpi folder. Done!

    ReplyDelete
  7. Very impressive stuff. I've just started getting into this and it's going to be interesting to see what can be achieved. Thanks for you efforts in posting.

    ReplyDelete
  8. I can not connect minecraft to my PC

    ReplyDelete
    Replies
    1. ?

      What are you trying to connect? Do you want some advice? Some additional information would be useful. What are you doing? Do you receive any error message? etc

      Delete
  9. Hi Martin,

    This is Anjali from Computing History. I have been reading/following your book and enjoying it!

    We're organising a Minecraft Day at the museum later this week. May I use your StarterKit and a couple of the exercises as an introductory workshop for the kids? The kids will be bringing their own machines and we will have to send out download instructions for the PC/MAC StarterKit. Is this alright or is this copyrighted stuff?

    Many thanks,
    Anjali

    ReplyDelete
    Replies
    1. Hi Anjali,

      Sorry for taking a little while to come back to you. I have been on holiday for a couple of weeks. I hope your workshop went well, I would have loved to have been there.

      The downloadable content is provided publicly and you are free to use the starter kits.

      The content of Adventures in Minecraft is copyrighted but we will have no problems with you using it as an introduction for your workshops, I suppose all I ask is that you are open about where it came from and obviously don't reproduce the whole of the book.

      If you need help or have more questions, I would encourage you to use the Adventures in Minecraft forum, which is much better monitored. http://www.stuffaboutcode.com/p/adventures-in-minecraft-forum.html

      Martin

      Delete
  10. Hi Martin!
    First of all... great job on this... this is super awesome!
    I was just wondering if you could help me out. (I'm sorry if this is inappropriate)
    I'm trying to work on my thesis and was thinking of doing a companion app for Minecraft.
    I was just wondering if this could be used in such a way? I'm mainly looking for being able to get information from Minecraft to show in my app as I'd like to update the app through things that happen in the game.

    Apologies again for any bother and thanks!
    Ryan

    ReplyDelete
  11. Hello Martin, I know that it's been a while since this was posted, but I'd love some feed back. I want to learn how to add blocks/mobs to minecraft pi! There must be a way to do it, but so far I have not found any help online. I would really appreciate it if you were to help point me to where I could gather the information on how to do such a thing! Thank you!
    -Joseph

    ReplyDelete
    Replies
    1. Not possible in the slightest. The API is VERY limited.

      Delete
  12. Hi, Martin

    I'm 12 yars old, I'm starting to read your book, but I can´t find the started kit to downland it in anayamultimedia.es. Could you help me please?

    Thanks a lot

    David

    ReplyDelete
    Replies
    1. Hi David,

      Im guessing you are reading the spanish translation? Unfortunately i dont speak spanish, so its difficult for me to find it on anayamultimedia.es but you can download it direct from http://wiley.com/go/adventuresinminecraft, which is the English publication, it will be exactly the same though.

      Delete
  13. Hi Martin

    I found it, and I´ve already downloaded.

    Thanks a lot.

    ReplyDelete
  14. Hi, wondering if it is possible to change the settings for Minecraft Pi to invert the mouse? You can change the "options.txt" in normal Minecraft to do this. Can you do it on a Pi? Cheers.

    ReplyDelete
    Replies
    1. I have never looked sorry. I certainly havent seen any options for it.

      Delete
  15. Hello, if you didn't know, you can play minecraft PC now on raspberry pi 2 and 3 along with optifine using these instructions...
    https://www.raspberrypi.org/forums/viewtopic.php?f=78&t=137279

    ReplyDelete
  16. This comment has been removed by the author.

    ReplyDelete
  17. Good Day, Martin.

    I am new to Raspberry, and Minecraft Pi. My daughter is quite fascinated with Minecraft (XBOX edition), and wants to write mob mods (unicorns, dragons, etc) for the Pi. Can you recommend a good resource that will walk through the code relevant to this activity? Hopefully a descriptive blog or forum post, but if a written manual, that would be good, too.

    Thanks in advance for your help.

    Jim

    ReplyDelete
    Replies
    1. check out the learning resources on RaspberryPi.org/resources, there are some great Minecraft ones e.g. https://www.raspberrypi.org/learning/getting-started-with-minecraft-pi/

      I would also recommend the book "adventures in minecraft" ;)

      Delete
  18. I've built on your Sounds project - e.g., different footsteps for different surfaces, "wind" sound when flying, "crunches" when you destroy a block... Runs ok, but the block-crunch routine can be a bit laggy and would probably benefit from utilizing threads, which are a level beyond my ability. Anyone want to have a go at improving it?

    ReplyDelete
    Replies
    1. Perhaps a link to your code might be useful?

      Delete
  19. Great list, I love it! Minecraft is so addictive I have found myself stuck with the college paper due tomorrow! But luckily they wrote my paper in one day, so my grades were saved. I know that cheating is bad but I had no choice:(

    ReplyDelete
  20. Here's an error code from the vec3 library:
    Traceback (most recent call last):
    File "/home/pi/minecraft_super_server/Minecraft_Super_Server.py", line 138, in
    gameCode = player_vote()
    File "/home/pi/minecraft_super_server/Minecraft_Super_Server.py", line 49, in player_vote
    if (placements[playerCount - 1] > 0):
    File "/usr/lib/python2.7/dist-packages/mcpi/vec3.py", line 59, in __cmp__
    dx = self.x - rhs.x
    AttributeError: 'int' object has no attribute 'x'
    Help me please!

    ReplyDelete
  21. this is my results..

    https://www.facebook.com/permalink.php?story_fbid=1154896404583688&id=100001900172060

    ReplyDelete
  22. import mcpi.minecraft as minecraft
    mc = minecraft.Minecraft.create("localhost")
    pos = mc.player.getTilePos()
    print(pos.x)
    print(pos.y)
    print(pos.z)

    result in python
    437
    0
    210

    result in Minecraft
    632
    64
    468

    why?

    use Starter Kit PC

    ReplyDelete
    Replies
    1. The coordinates returned by the API are relative to the spawn position. It's always been that way although I have been thinking for a while that it may be worth adding a switch in the config of RaspberryJuice.

      Delete
  23. Hello Martin, from Paris France.

    Just got your Adventures in Minecraft, I'm pretty enthusiast about it.

    A few days before I succeeded setting up Minecraft on a Raspberry Pi 3, thanks to Daniel Lemire's tutorial : http://lemire.me/blog/2016/04/02/setting-up-a-robust-minecraft-server-on-a-raspberry-pi/#comment-264730

    Playing with my seven year old daughter on this Minecraft server, I was wondering if by any chance there was a way to enable / apply the Python scripts your refering to ?

    Thanks for any help. All the best.

    ReplyDelete
    Replies
    1. Hi,

      If you want to use the full version of Minecraft and the Minecraft server on your Pi rather than Minecraft: Pi edition, you will need to install RaspberryJuice on your Minecraft server (http://www.stuffaboutcode.com/2013/06/programming-minecraft-with-bukkit.html).

      I would also download the starterkit from the wiley website if you are using the full version of Minecraft as this has everything in it you need to know. Follow chapter 1 of Adventures in Minecraft for a full walkthrough.

      Martin

      Delete
  24. Thank you Martin, it's very kind. I'm going to give a try.
    Raphael.

    ReplyDelete
  25. Hello! Hoping you're still actively supporting this. I'm interested in trying out this mod with about 60 students on a server. I'm currently able to run it locally and am working on running this on AWS. Would love to email with you for some help deploying the extra features!

    ReplyDelete
    Replies
    1. Hi,

      I take it you are using RaspberryJuice on your server? If so, its probably better to raise an request (as an issue) on its github page https://github.com/zhuowei/RaspberryJuice that way we can track progress and potentially get support from others.

      Martin

      Delete
  26. Can we connect multiple people to the same Minecraft server or does the RaspberryJuice plugin only work with a single player?

    ReplyDelete
    Replies
    1. No you can use it on multiplayer servers. Have a look at the "entity" functions.

      Delete
  27. Can you edit Minecraft 1.13.1 for python server ? (Because I wanna use this version , thanks .)

    ReplyDelete

Note: only a member of this blog may post a comment.