Solved Send color Title and SubTitle from config

Discussion in 'Plugin Development' started by Mauzuk, Jul 19, 2020.

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

    Mauzuk

    I need help with my mistake. I need to send a colored Title and SubTitle to the player when the config is true. But how do I make a colored Title and SubTitle out of a config and send it to a player, I'm still getting an error.

    Code:
    public void onJoin(PlayerJoinEvent e) {
            Player p = e.getPlayer();
            if(plugin.getConfig().getBoolean("Title_Join") == true) {
                p.sendTitle(ChatColor.translateAlternateColorCodes('&', plugin.getLang().getString("Title_Join.title"), plugin.getLang().getString("SubTitle_Join.subtitle")));
            }
     
  2. Online

    KarimAKL

    @Mauzuk You have your parenthesis in the wrong places, you currently use
    ChatColor#translateAlternateColorCodes('&', String, String) instead of ChatColor#translateAlternateColorCodes('&', String).
     
  3. Offline

    Mauzuk

    And how do I set up Title and SubTitle to be sent? If I put it separately, they will send 2x Titles, right?
     
  4. Online

    KarimAKL

Thread Status:
Not open for further replies.

Share This Page