Solved Display player name when broadcasting

Discussion in 'Plugin Development' started by Icelaunche, Feb 9, 2014.

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

    Icelaunche

    Hey,
    I am trying to broadcast that a player swore to the server and when I do that this is what comes up in chat: http://imgur.com/cCAwsdW

    Is there a way to make it ONLY display the name?
     

    Attached Files:

  2. Offline

    Iaccidentally

    Paste the code you are using, but I'm going to guess that you are using CraftPlayer
     
  3. Offline

    Icelaunche

    Iaccidentally

    Here is the code I am using:

    Code:java
    1.  
    2. Bukkit.getServer().broadcastMessage(ChatColor.DARK_RED + "[SafeChat] " + ChatColor.RED + e.getPlayer() + ChatColor.DARK_RED + " has been warned!");
    3.  
     
  4. Offline

    Iaccidentally

    change e. getPlayer() to e.getPlayer().getName() on line 12
     
  5. Offline

    Icelaunche

    Ah that makes sense. Thanks so much!
     
Thread Status:
Not open for further replies.

Share This Page