Pocketmine-mp: cancelling EntityDamageEvent Doesn't cancel fall damage

Created on 6 Jun 2019  路  1Comment  路  Source: pmmp/PocketMine-MP

Issue description

  • entity die when falling even if the damage event is cancelled

    Steps to reproduce the issue

  1. make a zombie fall from a really high area

OS and versions

  • PocketMine-MP:This server is running PocketMine-MP 3.8.1 for Minecraft: Bedrock Edition v1.11.0 (protocol version 354)
  • PHP:7.2
  • Server OS:Windows 10

Plugins

public function onDamage(EntityDamageEvent $event){
    if (!$event instanceof EntityDamageByEntityEvent) return;
    $victim = $event->getEntity();
    if ($victim instanceof Player or !$victim instanceof Living) return;
    $event->setCancelled(true);
}

Crashdump, backtrace or other files


Invalid

Most helpful comment

if (!$event instanceof EntityDamageByEntityEvent) return;

facepalm

>All comments

if (!$event instanceof EntityDamageByEntityEvent) return;

facepalm

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Muqsit picture Muqsit  路  3Comments

RedstoneAlmeida picture RedstoneAlmeida  路  3Comments

beetree picture beetree  路  3Comments

jasonwynn10 picture jasonwynn10  路  3Comments

sergeysova picture sergeysova  路  3Comments