Listening for chat

Discussion in 'Plugin Development' started by aPandaification, Jul 17, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    aPandaification

    So this may sound like a very noobish question but how do I listen for chat? I remember there being listeners for player events but I can't find them in the api I'm wondering if it changed. What I am trying to do is that whenever someone says 'I need food' it sets their hunger level to full. Can anyone help me out with this?
     
  2. Offline

    pzxc

    Code:
    @EventHandler
    void onPlayerChat(PlayerChatEvent e) {
        if (e.getMessage().toLowerCase().contains("i need food")) e.getPlayer().setHungerLevel(20);
    }
     
    aPandaification likes this.
  3. Offline

    aPandaification

    hurpadurpahurp wow I feel retarded now... thanks
     
Thread Status:
Not open for further replies.

Share This Page