Solved lowercase chat

Discussion in 'Plugin Development' started by chikenlitle99, Aug 29, 2014.

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

    chikenlitle99

    Code:java
    1. public void onLowerCase(AsyncPlayerChatEvent e){
    2.  
    3. String message = e.getMessage();
    4. Player player = e.getPlayer();
    5.  
    6. if(player.hasPermission("NoSwear.ignore")) return;
    7. if(plugin.getConfig().getBoolean("Chat_lowercase")){
    8.  
    9. e.setMessage(message.toLowerCase());
    10. player.sendMessage(prefix + "Do not use caps!");
    11. }
    12. }


    do not work
     
  2. You forgot this at the top of the method ->
    Code:java
    1. @EventHandler (priority = EventPriority.NORMAL)


    Also you need to register the events and extend the Listener class.

    Please post your full class to make sure you havnt left anything else out.
     
    chikenlitle99 likes this.
  3. Offline

    chikenlitle99

    @teozfrank
    Hahaha I not register the event, thanks
     
Thread Status:
Not open for further replies.

Share This Page