Solved Stick turning pink and black when hitting

Discussion in 'Spigot Plugin Development' started by Remy2402, Apr 24, 2016.

  1. Heyo! So with my enchanted stick seen in this screenshot,

    [​IMG]

    Whenever I hit someone with it, it turns into this:

    [​IMG]

    But, it still has the same damage, effects etc. Any ideas why this might be happening?
     
  2. code?
     
    • Agree Agree x 1
  3. Oops :p

    [​IMG]

    This is the creating of the stick. There is nothing happening on the damage event so I didn't include that.
     
  4. Interact event or anything of the sort?
     
  5. Why do you use addUnsafeEnchantment. Use addEnchantment()
     
  6. This ^
     
    • Agree Agree x 1
  7. I think in this case, addUnsafeEnchantment is correct.
     
  8. It's a stick. Would return errors if I tried adding enchantments to a stick I believe.

    Anyhow, I did some trial and error and found that this is the problematic line. Not sure why though?

    [​IMG]

    EDIT: This is the entitydamagebyentityevent
     
  9. Why are you setting the durability? The item will glitch out in pink & black when you specify an invalid durability value. For a stick item, the only valid value is 0.
     
  10. That is very true. I am making a kitpvp plugin and I usually use that line for swords :) Thanks!
     
    • Like Like x 1