pip install mcpi-listener
from mcpi.minecraft import Minecraft
from mcpi_listener import McpiListener
mc = Minecraft.Create()
listener = McpiListener(mc)
for chat_post in listener.listen_chat_posts():
print(chat_post)
from mcpi.minecraft import Minecraft
from mcpi_listener import McpiListener
mc = Minecraft.Create()
listener = McpiListener(mc)
for block_hit in listener.listen_block_hits():
print(block_hit)
from mcpi.minecraft import Minecraft
from mcpi_listener import McpiListener
mc = Minecraft.Create()
listener = McpiListener(mc)
for projectile_hit in listener.listen_projectile_hits():
print(projectile_hit)
from mcpi.minecraft import Minecraft
from mcpi_listener import McpiListener
mc = Minecraft.Create()
listener = McpiListener(mc)
for chat_post in listener.listen_chat_posts():
message = chat_post.message
if message.lower() == "hi":
mc.postToChat("hello!")