Solved 1.6.1 getHealth() ambiguous

Discussion in 'Plugin Development' started by andf54, Jul 4, 2013.

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


    I need to update my plugin, but I have no idea how to fix the issue.

    double hp = wrapped.getHealth(); gives me: The method getHealth() is ambiguous.

    Im guessing it has something to do with this:
    1. Github:
    2. - int getHealth();
    3. + double getHealth();
    4. +
    5. + /**
    6. + * This method exists for legacy reasons to provide backwards
    7. + * compatibility. It will not exist at runtime and should not be used
    8. + * under any circumstances.
    9. + */
    10. + @Deprecated
    11. + int _INVALID_getHealth();

    Could someone explain what bukkit team is up to?
  2. Offline


    they changed it to doubles. Are you asking to get it or set it?
  3. Offline


    setHealth isn't a problem.

    I need .getHealth(), which gives me an error just for calling it.

    "The method getHealth() is ambiguous for the type LivingEntity"
  4. Offline


    This question was just answered in my thread, go have a look
    andf54 likes this.
  5. Offline


    Where can i get bukit 1.6.1?
  6. Offline


  7. Offline


    Ok, found the solution:
    R-click your project-> Properties-> Java Build Path-> Order and Export
    Your bukkit.jar must be above your craftbukkit.jar.

    Not exactly. It wasn't very clear and it said to have bukkit.jar below craftbukkit.jar. It did help, however. Thanks.
    Goty_Metal likes this.
  8. Offline


    Oh yeah, I forgot to mention that. Glad it helped though
  9. Thanks pal that fixed my problem :)
Thread Status:
Not open for further replies.

Share This Page