SpockBotMC / SpockBot

High level Python framework for building Minecraft clients and bots.
MIT License
198 stars 47 forks source link

chat API for listen for specific event types #180

Closed luken closed 9 years ago

Gjum commented 9 years ago

This is provided already for any listen_event that ends with achievement, admin, announcement, emote, incoming, outgoing, text:

class MyPlugin(PluginBase):
  events = {'chat_incoming': 'on_chat_incoming'}

  def on_chat_incoming(self, e, data):
    print(data['name'], 'said', data['message'])

See also #179.