Modify ItemStack default attributes

Discussion in 'Spigot Plugin Development' started by f_i_r_e_dog, May 24, 2016.

  1. Hello fellow coders,

    Currently I am working on a MMORPG plugin for my server, but I've hit a bump.

    Basically one of the things this plugin does is add custom weapons like a wooden club. This wooden club is a wooden sword with a custom durability value and a custom texture assigned to that value. This works great, but the wooden club is actually a wooden sword so it inherits the wooden swords attributes (attackSpeed, attackDamage)

    I managed to add attributes to an ItemStack and this works fine without any errors, but I am not satisfied with the result. When I add the attackSpeed attribute with a value of 1 it doesn't change the wooden swords (wooden club) value to 1, but it adds 1, +1

    That's not what I want, I need a way of modifying the default values instead of adding values.

    I've done some research and as far as I know this seems rather impossible, but who knows what amazing ideas you guys will come up with!

    Thank you for reading this. If you are capable of helping me I am looking forward to hearing from you!