player.sethealth won't work

Discussion in 'Plugin Development' started by barbaroes, Sep 5, 2013.

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

    barbaroes

    I'm trying to make a plugin (first one) and player.setHealth(20); wont work.
    public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){
    Player player = (Player) sender;

    if(commandLabel.equalsIgnoreCase("heal") || commandLabel.equalsIgnoreCase("mp-heal")){
    if(args.length == 0){
    player.setHealth(20);

    So everytime that goes in, the whole player.setHealth gets underlined yellow, and it crosses out setHealth. Anyone know why?
     
  2. Offline

    kbunkrams97

    barbaroes
    player.setHealth(int health); has been deprecated due to a change in the Minecraft code. The function now uses doubles so you need to change the 20 to 20.0
     
  3. Offline

    barbaroes

Thread Status:
Not open for further replies.

Share This Page