arpruss / raspberryjammod

Raspberry Jam Mod - a Mod Forge Minecraft mod implementing most of Raspberry Juice/Pi API
http://www.instructables.com/id/Python-coding-for-Minecraft/
Other
348 stars 94 forks source link

mcpi requesterror. #64

Open JamesParkerStrand opened 1 year ago

JamesParkerStrand commented 1 year ago

I am trying to use the spawn entity function and it's not working. here is the code.

from mine import *

mc = Minecraft()

mc.spawnEntity(10,10,10,VILLAGER)

Here's the error I am getting

Traceback (most recent call last):
  File "C:\Users\Name\AppData\Roaming\.minecraft\mcpipy\camera.py", line 13, in <module>
    mc.spawnEntity(10,10,10,VILLAGER)
  File "C:\Users\Name\AppData\Roaming\.minecraft\mcpipy\mcpi\minecraft.py", line 264, in spawnEntity
    return int(self.conn.sendReceive("world.spawnEntity", args))
  File "C:\Users\Name\AppData\Roaming\.minecraft\mcpipy\mcpi\connection.py", line 134, in sendReceive
    return self.receive()
  File "C:\Users\Name\AppData\Roaming\.minecraft\mcpipy\mcpi\connection.py", line 128, in receive
    raise RequestError("%s failed"%self.lastSent.strip())
mcpi.connection.RequestError: world.spawnEntity(10,10,10,Villager) failed

Is there anything I can do to resolve this error?

arpruss commented 1 year ago

The entity goes before the coordinates.

JamesParkerStrand commented 1 year ago

The entity goes before the coordinates.

Thanks, it worked