Solved Detecting if EntityDamageByEntityEvent is cancelled

Discussion in 'Plugin Development' started by michaelkrauty, Jul 21, 2014.

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

    michaelkrauty

    I need my code to run only if this event is cancelled, however it's running even if another plugin (WorldGuard) cancels the event.

    Code:java
    1. @EventHandler
    2. public void onEntityDamage(EntityDamageByEntityEvent event) {
    3. if (!event.isCancelled()) {
    4. // code here
    5. }
    6. }


    Any ideas?
     
  2. Offline

    fireblast709

  3. Offline

    Zupsub

    It looks nicer if you do @EventHandler(ignoreCancelled = true) instead of that if.
     
  4. Offline

    michaelkrauty

    that worked, thank you
     
Thread Status:
Not open for further replies.

Share This Page