Benedikt05 / BetterAltay

A server software for Minecraft: Bedrock Edition in PHP
GNU Lesser General Public License v3.0
81 stars 41 forks source link

EntityDamageByEntityEvent setBaseDamage Bug #274

Open DANRULEZ123 opened 5 months ago

DANRULEZ123 commented 5 months ago

Issue description

Steps to reproduce the issue

  1. Make an Event in your plugin.
  2. Make the function for your event (EntityDamageByEntityEvent) and call setBaseDamage();

OS and versions

Crashdump, backtrace or other files

public function onDamage(EntityDamageByEntityEvent $event):void{ $damager = $event->getDamager(); $entity = $event->getEntity(); If($event->isCancelled()){ return; } if($damager instanceof Player and $entity instanceof Player){ $event->setBaseDamage(1); // Completely removes attack speed... $damager->sendMessage("Damage Event Triggered."); } }