Solved Ambigious getDamage

Discussion in 'Plugin Development' started by DreTaX, Oct 6, 2013.

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

    DreTaX

    Hello.

    I have a new plugin called UnleashTheKraken. I'm just finishing it to release it, but I stuck.
    I can't solve my issue with getDamage. I'm using EntityDamageEvent e for it.

    [​IMG]


    I even tried:
    Code:java
    1. int damage = (int) e.getDamage();


    The error was:
    Code:
    Caused by: java.lang.NoSuchMethodError: org.bukkit.event.entity.EntityDamageEvent.getDamage()
     
  2. Offline

    xTrollxDudex

    DreTaX
    Build against Bukkit...
     
  3. Offline

    DreTaX

    That's fine. I'm using bukkit for building always, with maven. But if i use the compiled plugin in my server, with craftbukkit, it fails.

    Edit: That picture was taken with adding craftbukkit to the library to see the error. Btw, i still compiled the plugin with bukkit, and not craftbukkit
     
  4. Offline

    xTrollxDudex

    DreTaX
    Try directly building against bukkit instead of using maven
     
  5. Offline

    Goblom

    This is working for me.
    Code:java
    1. public void test(EntityDamageEvent event) {
    2. double damage = event.getDamage();
    3. }
    What versions of Bukkit/CraftBukkit are you building against?
     
  6. Offline

    DreTaX



    Tried still the same.

    Right now i tried with Bukkit RB 1.6.2, but i even tried 1.6.4-R0.1-SNAPSHOT

    Could you test it with an event, with a server?



    It works for me too if i use bukkit for attachment, and compile with it, but running it with a server it throws errors.
    As i said i only put craftbukkit once in my libraries to see what's the error in the code

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 4, 2016
  7. Offline

    Goblom

    If you are building with CraftBukkit (Or have CB as a dependency) you HAVE TO HAVE the same craft bukkit version on the server you are testing on.
     
  8. Offline

    DreTaX

     
  9. Offline

    Goblom

    Well, if nothing is working, then would you mind posting the code? If you dont want it public you can PM me it.

    Posting code can help people trying to help you find/fix the problem.
     
  10. Offline

    DreTaX

    I'm going to PM it, because It's a big plugin.

    Problem solved. The problem was CB RB 1.5.2-1.0, which i was testing on.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 4, 2016
Thread Status:
Not open for further replies.

Share This Page