Getting the damage of an item in hand

Discussion in 'Plugin Development' started by Jnorr44, Oct 10, 2013.

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

    Jnorr44

    I am trying to hit through a wall, and using a realistic-shot lib that I wrote set to ignore walls. So... I have the whole hit-through-wall part done, but what about damage? I am using entity.damage(int amount, Player player), but I need the amount. I have tried getItemInHand().getDurability(), but I am sure thats wrong. Does anyone know any method that gets the item damage?

    EDIT: Oh, and I may be able to dig into NMS/OBC using reflection, as long as no package names are required.
     
  2. Offline

    MrSparkzz

    Jnorr44
    I don't do much with blocks/items, but instead of
    Code:java
    1.  
    2. .getDurability();
    3.  

    do this
    Code:java
    1.  
    2. .getDamageValue();
    3.  
     
  3. Offline

    Jnorr44

    That method doesn't exist as far as I can tell.
     
Thread Status:
Not open for further replies.

Share This Page