Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4724

Beginners • How to use Python in Minecraft

$
0
0
Hi, I gave my kid an RP5, but it’s all very new for us.

We have installed Minecraft Pi and it’s working. But we want to use Python with it. We opened Thonny and started with this code we found on the RP website

from mcpi.minecraft import Minecraft

mc = Minecraft.create()

mc.postToChat("Hello world")

But when we run this we get a message that the mcpi is not found.

For learning purposes: what does this mean
For playing purposes: how can we fix this?

Thanks very much.

Statistics: Posted by Barth — Sat Dec 21, 2024 3:13 pm — Replies 1 — Views 48



Viewing all articles
Browse latest Browse all 4724

Trending Articles