Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EntityDamageByEntityEvent setBaseDamage Bug #274

Open
DANRULEZ123 opened this issue Jun 7, 2024 · 1 comment
Open

EntityDamageByEntityEvent setBaseDamage Bug #274

DANRULEZ123 opened this issue Jun 7, 2024 · 1 comment

Comments

@DANRULEZ123
Copy link

Issue description

  • Expected result: The base damage is changed to the set amount with attack speed normal.
  • Actual result: Calling $event->setBaseDamage(1.0); // or 1 or any int/float completely removes attack speed.

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

  • Altay: 1.21.1
  • PHP:
  • If you remove all plugins, does the issue still occur?

  • No

  • If the issue is not reproducible without plugins:

    • Can you provide sample, minimal reproducing code for the issue? If so, paste it in the bottom section

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.");
}
}

@vp817
Copy link
Contributor

vp817 commented Jun 24, 2024

I don't think this is the right function for this thing. Since you want to make the speed of attack faster, consider using "setAttackCooldown"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants