Solved EntityDamageByEntityEvent setCancelled not working

Discussion in 'Plugin Development' started by sago92, May 19, 2019.

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

    sago92

    Dear all,

    I am currently working on my own plugin, and figured out that the setCancelled don't work on the EntityDamageByEntityEvent.

    Code:
    @EventHandler(priority = EventPriority.LOWEST)
    public void a(EntityDamageByEntityEvent event) {
        event.setCancelled(true);
        RightOfConquest.engine.getLogger().info("1");
    }
    Code:
    @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
    public void b(EntityDamageByEntityEvent event) {
        RightOfConquest.engine.getLogger().info("2");
    }
    The console output is 1 and 2. If I try this for example with the PlayerMoveEvent it works as expected and the output is only 1, but not with the EntityDamageByEntityEvent.

    I took a look into the documentation, but there isn't mentioned that this event wouldn't support it.

    Did I miss something or is it maybe a bug?

    My current Server Version: [​IMG]

    Regards




    SOLUTION
    Because the priority of my first event was lowest, it seems another plugin on my Server changed the cancelation state to false. If I increase the priority it works as expected.
     
    Last edited: May 19, 2019
Thread Status:
Not open for further replies.

Share This Page