Solved Cancelled PlayerInteractEvent do not cancel sword damage and arrow load

Discussion in 'Spigot Plugin Development' started by PappaProntaTeam, Sep 3, 2016.

Thread Status:
Not open for further replies.
  1. Hi,
    i'm trying to cancel the PlayerInteractEvent for some particular items, but in spigot 1.10.2 calling setCancelled(true) does not block the damage dealt by a sword or the bow from loading an arrow (it does block arrow load on server, but client see arrows number decreasing). Is this a bug? Is there any workaround for that?
     
  2. Serializator

    Supporter

    The PlayerInteractEvent is called when you interact with air or another block, that's why the damage isn't cancelled. But could you explain a bit more about what you're trying to do when a bow is charging?
     
  3. If you want to prevent players from damaging entities, look into EntityDamageByEntityEvent.
     
Thread Status:
Not open for further replies.