Instructions for installing and running Minecraft on Raspberry Pi

Minecraft is one of the world’s favorite gaming legends. Minecraft is available on every platform, and the Raspberry Pi is no exception.

Install Minecraft Pi Edition on Raspberry Pi
Minecraft: Pi Edition

Minecraft A great and interesting open world game on multiple platforms. You can easily build a city, a house, even a dream life in this game. You can play Minecraft on many devices including Raspberry.

Instructions for installing Minecraft Pi on Raspberry Pi

The game is minecraft pie version

Start the Raspberry Pi, log in, and then type the following command:

StartX

This command runs in the graphical interface. Click on the icon LXTerminal to open a terminal window. Use the following command to download the Minecraft package from the home page:

wget https://s3.amazonaws.com/assets.minecraft.net/pi/minecraft-pi-0.1.1.tar.gz

Then use the following command to extract the contents:

tar -zxvf minecraft-pi-0.1.1.tar.gz

It creates a folder and you need to extract some files from it. Open this folder by typing:

cd mcpi

Finally, you can run the application using the command:

./minecraft-pi

The Minecraft Pi window will open and it should look like this:

Minecraft Pi version of the opening window

Click on "start the game"To start and create a world of discovery.

World of Minecraft Pi Edition

Minecraft runs at a fixed resolution, so may vary depending on your screen settings. You can maximize the window to its full size, run it in full screen mode. However, it can affect the mouse pointer. So please use keyboard too.

Use the keyboard while playing Minecraft Pi Edition

More desktop icons

Boring to type commands every time you want to play, isn't it? So why not create a desktop shortcut?

First save the image to your computer"minecraft.pngThen copy to the folder MCPI.

Right-click on the LXDE desktop, select “Create something new"after"empty file"

filename"minecraft.desktop". Click ok And the shortcut file will appear on the desktop.

Right click on the file .desktop Again, select "leaf padThis file will open in a text editor.leaf pad"

Copy the following code "leaf pad":

[Desktop Entry]Name = Minecraft Pi Version
Comment = Launch Minecraft Pie Edition!
Exec=sh -c 'cd ~/mcpi && lxterminal -l -t Minecraft -e ./minecraft-pi'
icon=/home/pi/mcpi/minecraft.png
terminal = false
type = application
class = application; game
StartupNotify=true

use menu"file"Save file and exit"leaf pad"

The shortcut now has a nice icon and is called "Minecraft Pi Edition"

Create Minecraft Pi Edition Quick Access Icon

Double clicking on this icon will open Minecraft.

Use Minecraft

Here are some shortcuts to help you work faster when playing Minecraft Pi

abandon Stop/Menu

w let's go

A Move right

to come in the background

It's easy Move right

E Show block storage

1 - 8 Select Widgets in the Quick Bar

Left mouse Destroy the block

That mouse Place the block

Space bar Jump (increase in fly mode)

conversion Stealth (decreased in fly mode)

You can use the mouse to change the viewing angle. Scroll through the articles if you want to check them out Left mouse button to select blocks. When you see the inventory, you can use the WASD key combination to remove it by pressing it to enter to select blocks.

A double tap on the spacebar toggles fly mode on or off. You can immediately exit Minecraft Pi by clicking the icon [x] in the right corner of the game window.

Python API

The Python API lets you control the Minecraft world. By default, the Python API is pre-installed on the Raspberry Pi. It's a great way to build a framework and learn Python at the same time.

Release blocks as you move

The following code will place a flower behind each of your steps:

from mcpi.minecraft import Minecraft
from time import sleep

mc = Minecraft.create()

flower = 38

while True:
    x, y, z = mc.player.getPos()
    mc.setBlock(x, y, z, flower)
    sleep(0.1)

Now take a few steps forward and back. You can see the flowers in the background.

Leave flowers on your path in Minecraft

Because we use loops if true This happens forever when you go into the world of Minecraft. To turn it off, press Ctrl+ In the Python window.

Or try flying and see how attractive the flowers you put in the sky are:

Flowers are flying in the sky

Use it when you want to see flowers while walking on the lawn getBlock To find the block style you want:

x, y, z = mc.player.getPos()  # player position (x, y, z)
this_block = mc.getBlock(x, y, z)  # block ID
print(this_block)

This command tells you where the block is (0 is an air block). Move if you want to know what type of block the first from the value y and use it getBlock() To select the block type.

Now you know the ID of the standing block. You can run a loop to see the ID of the block you entered.

while True:
    x, y, z = mc.player.getPos()
    block_beneath = mc.getBlock(x, y-1, z)
    print(block_beneath)
The block is below

You can use the command when To choose whether to plant flowers or not.

grass = 2
flower = 38

while True:
    x, y, z = mc.player.getPos()  # player position (x, y, z)
    block_beneath = mc.getBlock(x, y-1, z)  # block ID

    if block_beneath == grass:
        mc.setBlock(x, y, z, flower)
    sleep(0.1)

You can make a long house like this:

if block_beneath == grass:
    mc.setBlock(x, y, z, flower)
else:
    mc.setBlock(x, y-1, z, grass)

Now when you walk on the grass, flowers bloom in the background. The next block will be grass if not grass.

Flowers bloom on the lawn you walk on in Minecraft

Play with TNT dynamite blocks

Another interesting block to try playing Minecraft on Raspberry Pi is TNT Explosives. To place a simple TNT block, use:

tnt = 46
mc.setBlock(x, y, z, tnt)

However, this block of TNT is annoying. Try using the data with 1:

tnt = 46
mc.setBlock(x, y, z, tnt, 1)

Now use the sword and left click on the TNT block. It activates and detonates within seconds. So try using a large frame made of several TNT blocks:

tnt = 46
mc.setBlocks(x+1, y+1, z+1, x+11, y+11, z+11, tnt, 1)

You will now see a "large" square filled with TNT blocks. Keep activating one of these blocks, then run away to see what happens Rendering graphics can be slow at this point because so many details are changing at once.

Minecraft pi explosion effect

I hope the article is useful for you.

Update at 2:11 - 11/09/2022
Similar games

Comment

Recommended