Error on command

Discussion in 'Plugin Development' started by thomasb454, Jan 7, 2014.

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

    thomasb454

    Hi, so I'm making a guard plugin for my prison server, when I remove the messages it's fine. However, when re-adding them, using the below code, it errors (error below code)

    Code:java
    1. Bukkit.broadcastMessage(Messages.GUARD_TOGGLE_OFF.replaceAll("%guard%", player.getName()));


    http://gyazo.com/7ca27abf704c5c07a56f5a6969818a54

    And yes, the Message class & the GUARD_TOGGLE_OFF message exists, also the "prefix" is at the top if the list of messages.

    Thanks,
    Thomas.
     
  2. Offline

    MrZoraman

  3. Offline

    thomasb454

  4. Offline

    MrZoraman

    Are you referencing multiple projects? Try recompiling all of your classes.
     
  5. Offline

    thomasb454


    Already have, using eclipse..
     
  6. Offline

    Xephiro

    Replace your replace method
    Code:java
    1. Bukkit.broadcastMessage(Messages.GUARD_TOGGLE_OFF.replaceAll("%guard%", player.getName()));


    To this
    Code:java
    1. Bukkit.broadcastMessage(Messages.GUARD_TOGGLE_OFF.replace("%guard%", player.getName()));


    Because replaceAll use a regular expresion to replace all the words conteined in and tryed your string "%guard%" as a regex.

    Is too diferent a 1 word string with a regular expresion

    Good Luck
     
  7. Offline

    thomasb454


    Nope...no work. :(
     
  8. Offline

    Xephiro

    Your error is becaus a file name GUARD_TOGGLE_ON is not found

    It's posible show more code ?
     
  9. Offline

    thomasb454


    It is there, what could would you like to see?
     
  10. Offline

    Xephiro

    When you use GUARD_TOGGLE_ON , you show only GUARD_TOGGLE_OFF no GUARD_TOGGLE_ON
     
  11. Offline

    thomasb454


    ...Why
     
  12. Offline

    Xephiro

Thread Status:
Not open for further replies.

Share This Page