Solved Preventing Snowballs From Knocking Items Out of Frames

Discussion in 'Spigot Plugin Development' started by xlis1, Apr 30, 2017.

  1. Hello! I have a plugin that uses snowballs as projectile weapons. the only problem is that they can knock items out of item frames, witch is not a very good thing when you have item frames everywhere in your main spawn area.

    Is there a way to prevent them from knocking the items out of frames?

    I tried canceling the HangingBreakByEntityEvent, however this did not stop the item from being knocked out or from me destroying the frame. upon further investigation i discovered i could only break the frame if i threw the snowball by hand (I spawn the snowballs upon right clicking a item). any help/advice would be nice, thank you!
  2. Try listening to and cancelling the EntityDamageByEntity
  3. Thanks! this worked.