Player Variable

Discussion in 'Plugin Development' started by badboysteee98, Apr 15, 2014.

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

    badboysteee98

    Hello Bukkit People,

    I need some help with getting a player. I don't really know if that is the right title for this but I have made a plugin where it check if a player has played before and if they haven't and if they have it's sends them a message like

    Welcome Back

    But if they haven't send them a message like

    Welcome to

    I need some help on getting the player name, like in the config so %player% means get the player's name so it will say

    Welcome Back, %player% in the config and then In-Game
    Welcome Back, badboysteee98

    So basically I think setting %player% to a player's name in the config
    So if I haven't explained this very well never done stuff like this before
     
  2. Offline

    Seadragon91

    The player class has a method named hasPlayedBefore, with that you can check if the player is new.
    For the message, use the replace method. Example
    Code:
    String message = "Welcome back %player%!";
    message = message.replace("%player%", player.getName());
     
    badboysteee98 likes this.
  3. Offline

    badboysteee98

Thread Status:
Not open for further replies.

Share This Page