PlayerChatEvents? Help!

Discussion in 'Plugin Development' started by 87pen, Nov 23, 2014.

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

    87pen

    I am learning how to make bukkit plugins, I wanted to start using chat Events so whenever a player with specific perms says "Juiz (Kill, Heal, Give)" or anything like that in chat they are healed, killed or given what they asked for but the old PlayerChatEvent doesn't work anymore so can anyone help teach me/show me how to make Player chat events.
    Code:java
    1. public final MyPlayerListener pl = new MyPlayerListener(this);
    2.  
    3. pm.registerEvent(Event.Type.PLAYER_CHAT, this.pl, Event.Priority.Normal, this);

    They don't work.
     
  2. Offline

    acer5999

  3. Offline

    87pen

    Is it really that old? XD guess I have been studying off of some really old stuff then :p
     
  4. Offline

    acer5999

    mhm, here's a code example from one of my plugins:
    Code:java
    1. @EventHandler (priority = EventPriority.HIGH)
    2. public void colourChange(AsyncPlayerChatEvent e) {
    3. Player p = e.getPlayer();
    4. String msg = e.getMessage();
    5. if (cc.containsKey(p)) {
    6. addChange(e,msg);
    7. }
    8. }
     
  5. Offline

    87pen

    Thanks, helps.
     
Thread Status:
Not open for further replies.

Share This Page