Closed syang closed 1 year ago
The custom attribute doesn't exist, instead look at what's next to it. For example:
custom.log.info
(mc.log.info(msg)
) Logs a message.
You would use mc.log.info("your message here")
.
You would use
mc.log.info("your message here")
.
I changed mod2.py into the following script.
from mcpi_addons.minecraft import Minecraft
mc = Minecraft.create()
mc.postToChat("Hello, I am Gavin!")
pos = mc.player.getPos()
mc.postToChat(pos)
mc.log.info("I am here")
Running python mod2.py
gives the following error
Traceback (most recent call last):
File "mod2.py", line 8, in <module>
mc.log.info("I am here")
AttributeError: 'Minecraft' object has no attribute 'log'
I did not run the ./build.sh step in your Readme file, so I guess it may be the reason?
It seems I called it logging
instead of log
, should be fixed now.
Here is my little script after I pip install the package
And then I run the script
$ python mod2.py
, and I got the following error message,Is it because I have not done anything about compiling section (did not run ./build.sh ....)