Minecraft: Pi Edition

Minecraft is a sandbox-style game made by the game company Mojang. Because it is a sandbox, there is no right or wrong way to play it. The concept behind the game is that you explore and build using different kinds of blocks in a randomly created world. It has been compared to a virtual LEGO set. If you can think it, you can build it in Minecraft.

It was originally developed for the Windows PC, but has since been ported to OS X, iOS, Android, and various game consoles. Mojang developed and released a port to the Raspberry Pi as a free download.

Installing and running

If you are running the latest version of Raspbian, Minecraft is now included by default. If you are running an older version of Raspbian, you can install Minecraft using apt-get, as follows:

  1. At the command line, type sudo apt-get update.
  2. Then, type sudo apt-get install minecraft-pi.
  3. From the desktop, double-click on the Minecraft Pi Edition icon, or from a desktop terminal, type minecraft-pi and press Enter.
    Installing and running

Creating a new Minecraft world

To create a new Minecraft world, perform the following actions:

  1. With Minecraft running, click on Start Game.
  2. Select Create new.
  3. After a few moments, you will enter into a brand new Minecraft world environment.

Using the Minecraft: Pi Edition Application Programming Interface

Now that you have created your Minecraft world, you can explore, fight creepers, create your own castle, and whatever else your mind can think of. The Raspberry Pi Edition includes something extra—a programming interface. You can use the Python programming language to hook into Minecraft and edit the game world with lines of code.

To use the Minecraft API, perform the following actions:

  1. Start the Python interactive shell by running python on the terminal.
  2. You will see >>>, which is where you will enter the Python commands.
  3. Enter the following commands:
    from mcpi import minecraft
    from mcpi import block
    mc = minecraft.Minecraft.create()
    mc.postToChat("I am using the API!")
    
  4. You should now see I am using the API message appear in your Minecraft window.
  5. Enter the following commands:
    player = mc.player.getPos()
    player
    
  6. An output similar to Vec3(46.0,1.0,-14.0) should appear.
  7. Enter the next command:
    mc.setBlock(player.x +1, player.y, player.z, block.GOLD_BLOCK)
    
  8. A golden block should appear directly in front of you:
    Using the Minecraft: Pi Edition Application Programming Interface

There are many more things you can do with both Python and the Minecraft API. From creating functions that will build a fortress to using loops to stack tons of TNT blocks, you can program the entire world.

For more API documentation, visit:

http://www.stuffaboutcode.com/p/minecraft-api-reference.html

Multiplayer Minecraft

Minecraft: Pi Edition is a multiplayer game. If you have other people running Raspberry Pis on your network, all they need to do is click on Join Game in the main menu, and all the currently running Minecraft worlds will be available for them to join.

Controls

Here is a list of the default keys in Minecraft:

Action

Key

Forward

W

Left

A

Down

S

Right

D

Inventory

E

Jump

Space

Fly/Fall

Double space

Menu

Esc

Place block

Left mouse click

Remove block

Right mouse click

Select quick inventory

19 or mouse wheel

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.146.255.249