[]Broadcasting

Discussion in 'Plugin Development' started by DevManABCD, May 9, 2014.

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

    DevManABCD

    someone knows why broadcast message adds [] to message? something like this: [HERE IS A MESSAGE]

    its my code:

    Code:java
    1. public void ChatToggling () {
    2. String block = configManager.blockMessage;
    3. String unblock = configManager.unblockMessage;
    4. block.replaceAll("[", " ");
    5. if(!this.ChatLocked) {
    6. for(int i=0;i<100;i++) {
    7. Bukkit.broadcastMessage("");
    8. }
    9. Bukkit.broadcastMessage(block.replaceAll("&", "§"));
    10. this.ChatLocked = true;
    11. }else {
    12. for(int i=0;i<100;i++) {
    13. Bukkit.broadcastMessage("");
    14. }
    15. Bukkit.broadcastMessage(unblock.replaceAll("&", "§"));
    16. this.ChatLocked = false;
    17.  
    18. }
     
  2. Offline

    DxDy

    I think you want
    Code:java
    1. block.replaceAll("[", " ");

    to be
    Code:java
    1. block = block.replaceAll("[", " ");

    as replaceAll will not modify the existing string if I remember correctly.
     
Thread Status:
Not open for further replies.

Share This Page