Solved String is not applicable for the arguments

Discussion in 'Plugin Development' started by SeniorCluckers, Jul 19, 2015.

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

    SeniorCluckers

    Code:
    Bukkit.broadcastMessage(instance.getConfig().getString("broadcast-message").replace("&", "§").replace("%player%", e.getPlayer().getName()).replace("%str%", i));
    Please help. "The method replace(char, char) in the type String is not applicable for the arguments (String, int)" Can't seem to fix this.
     
  2. Offline

    Hawktasard

    @SeniorCluckers
    String.valueOf(i) or "" + i, etc.
    You're trying to pass an integer instead of a string.
     
  3. Offline

    SeniorCluckers

    @Hawktasard
    Im trying to replace "count" with int i. So if in the config count will be replace with the number of i.
    Code:
    Bukkit.broadcastMessage(instance.getConfig().getString("broadcast-message").replace("&", "§").replace("%player%", e.getPlayer().getName()).replace("count", i));
     
  4. Offline

    Tecno_Wizard

  5. Offline

    SeniorCluckers

    @Tecno_Wizard I thought he miss understood sorry. I did what he said still did not work.

    EDIT* Works. Thank you.
     
    Last edited: Jul 19, 2015
Thread Status:
Not open for further replies.

Share This Page