Send chat Mesage

Discussion in 'Plugin Development' started by Ninjasturm, Apr 11, 2011.

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

    Ninjasturm

    Hello Community,

    for my plugin i need to know if bukkit supports sending chat messages and how i could do that.
    Sample code would be useful.
     
  2. Offline

    Sammy

  3. Offline

    ssell

    @Ninjasturm

    Do you want to send it to a specific player, or the entire server?

    Specific Player
    Code:
    Player player; //The player you want to send to. This is found a multitude of ways.
    
    player.sendMessage( "Message" );
    
    Entire Server
    Code:
    getServer( ).broadcastMessage( "Message" );
    
    You can also use colored text with

    Code:
    ChatColor.COLOR_YOU_WANT + "Message" + ChatColor.SECOND_COLOR + " a second color " + ...
     
  4. Offline

    iPhysX

    (he says thankyou)
     
  5. Offline

    Ninjasturm

Thread Status:
Not open for further replies.

Share This Page