Solved Why won't my flyspeed command work?

Discussion in 'Plugin Development' started by IkBenHarm, Apr 6, 2013.

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

    IkBenHarm

    Hello,
    i dont understand why my /flyespeed command won't work.
    Here is the code:

    Code:
            if(cmd.getName().equalsIgnoreCase("flyspeed")){
          if(args.length != 1){
          player.sendMessage(ChatColor.RED + "Use: /flyspeed 1/2/3/4/5/6/7/8/9/10");
          }
          if(args.length == 1){
          if(args[0].equals(1)){
          player.setFlySpeed((float) 0.1);
          }
          }
            }
    
    Please help

    EDIT: Also if i dont do flyspeed 1 but 2 and then set it to 0.3 or something
     
  2. Offline

    ZeusAllMighty11

    Instead of 1 as in int, use 1 as a string. "1"

    if(args[0].equalsIgnoreCase("1")){ }
     
  3. Offline

    IkBenHarm

Thread Status:
Not open for further replies.

Share This Page