Closed HashimTheArab closed 3 years ago
Both handlers are receiving the same event instance. The EntityDamageByEntityEvent handler is called first, and then the less specific handler (EntityDamageEvent) later. Therefore this is expected behaviour.
That said, there is no defined order in which these handlers will execute, so you shouldn't depend on this behaviour.
If you need one handler to be executed before another, you should use the @priority
attribute.
Issue description
Steps to reproduce the issue
OS and versions
Plugins
Plugins (2): Core v3.2.0, DevTools v1.15.0+dev
If the issue is not reproducible without plugins:
public function onDamage(EntityDamageEvent $event) : void { $event->cancel(); }
public function onDamageByEntity(EntityDamageByEntityEvent $event) : void { var_dump('called'); }
Crashdump, backtrace or other files