Weapon Damage

Discussion in 'Plugin Development' started by MinecraftMart, Jun 6, 2015.

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

    MinecraftMart

    If i make an itemstack, how would i set its weapon damage?
     
    Last edited: Jun 6, 2015
  2. Offline

    JasonDL13

    Use ItemStack#setDurability
     
  3. Offline

    MinecraftMart

    I Actually ment weapon damage
     
  4. Offline

    Monollyth

    Depending on what you mean, there are several ways to set the damage. You could add the sharpness enchantment, but I am assuming you don't want to do that. You could check the item meta/lore on an EntityDamageByEntity event, and if it equals something, you can set the damage to more or less.
     
  5. Offline

    MinecraftMart

    So I cant set the actual damage that is displayed underneath the weapon? Well id have to try the other way then, thanks.
     
  6. Offline

    Zombie_Striker

    @MinecraftMart
    Save the data somewhere of how much damage it should give (ItemMeta, Config, Map), and call the onEntityDamageByEntity event and check if the item has that data.
     
  7. Offline

    Monollyth

    @MinecraftMart You can clear the lore of the item, and set the damage in the lore with a custom lore, then read that line of lore when setting the damage.
     
Thread Status:
Not open for further replies.

Share This Page