Get the amount of damage an item SHOULD do, when used as a weapon

Discussion in 'Plugin Development' started by orange451, Aug 2, 2012.

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


    Without hardcoding a list of all the damages that certain items do, how could I find out (in code) the amount of damage an item should do to a player when he is struck by another player who is holding it.

    Example, Player A hits Player B with a Diamond Sword. Assuming I don't know how much damage a diamond sword does, how could I find it out? (again without hardcoding all these values).
  2. Offline


  3. Offline


    Are you planning to take armor into account?
  4. Offline


    Bukkit already does that when you damage someone.

    Obviously I tried the damageEvent, however, I am messing with how players are tagged in the server. The DamageEvent always returns 0 damage (unless I damage them specifically using .damage(x)).
  5. Offline


    Hmm, Javadocs don't make this very clear...


    So, it only returns the damage caused by Blocks? Doesn't make much sense. I'm pretty sure I've used getDamage() before successfully.
Thread Status:
Not open for further replies.

Share This Page