How to use a string in the .setFireTicks() function

Discussion in 'Plugin Development' started by jstuie, Jan 7, 2014.

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

    jstuie

    Hello,
    I am making a private plugin for my server, and i want to be able to troll a friend of mine. I want it so that whenever he tries to run a command, it sets him on fire, but whenever i try to use a string, whether it be through a function, a variable or just putting the string next to it, I get this 'The method setFireTicks(int) is undefined for the type String'

    Code:java
    1. }else if(command.equalsIgnoreCase("rl") && sender.equals("Saint_Goat")){
    2.  
    3. Player target = Bukkit.getServer().getPlayer("Saint_Goat");
    4. target.setFireTicks(3000);
    5. }


    any help appreciated
     
  2. Offline

    Xephiro

    Use
    Code:java
    1. int ticks = Integer.parseInt(YourStringHere);
    2. RandomLoc.getGoat().setFireTicks(ticks);


    This convert your string into integer value (this have a NumericFormatException if you put a no numeric character)
     
  3. Offline

    Ytry

    Set fire ticks only takes an int as a parameter all it does is set the ticks a fire is burning for.
     
Thread Status:
Not open for further replies.

Share This Page