Hello Minecraft World!

I bet a lot of you readers want to know how to use the Python API for Minecraft Pi Edition.

To post a message to the chat, type into geany:

from mcpi.minecraft import Minecraft

mc = Minecraft.create()

mc.postToChat(“Hello Minecraft World!”)

 

You can replace Hello Minecraft World! with anything. It must be in speach marks though, unless you are putting a variable inside. For example:

from mcpi.minecraft import Minecraft

mc = Minecraft.create()

my_message = “Hello Minecraft World!”

mc.postToChat(my_message)

 

which does exactly the same function.

Enjoy!

Epic Chas Gamer 😂

Go on, you know you want to! Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s