Question Need Help With Config

Discussion in 'Bukkit Help' started by Concar123, Mar 31, 2015.

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

    Concar123

    I have been having problems lately with my config.yml. When i was trying to list "bad words" for my plugin. For some reason only the first one was working....
    i did it like this:
    badwords:
    - (listed word)
    - (listed word)
    and so on.................
     
  2. Offline

    Concar123

    yes, hang on.....

    here it is!
    @EventHandlerpublic void onPlayerChat(AsyncPlayerChatEvent e) {
    for (String word : e.getMessage().split(" ")) {
    if(getConfig().getStringList("change").contains(word)) {
    e.setMessage(e.getMessage().replace(word, ChatColor.RED + "Turtles!" + ChatColor.WHITE));}
    if(getConfig().getStringList("badwords").contains(word)) {
    e.setMessage(e.getMessage().replace(word, "turtle"));e.getPlayer().sendMessage(ChatColor.RED + "do not curse!");}
    }
    }

    dang copy/paste sucks :l sorry about that

    @bwfcwalshy
    thanks for help in advance!

    and 1 other thing... how do i set a players health to args? like for example
    if(label.equalsignorecase("sethealth")) {
    Player.setHealth(-the args they put-);
    }
     
    Last edited by a moderator: Mar 31, 2015
Thread Status:
Not open for further replies.

Share This Page