PHP: /** @var float $damage *//** @var Entity $entity */$entity->setHealth($entity->getHealth() - $damage); This method ignores armor, strength, resistance, etc. EDIT: if you dont want the damage to ignore armor you must use Entity::attack(EntityDamageEvent $event); PHP: /** @var float $damage *//** @var Entity $entity */$entity->attack(new EntityDamageEvent($entity, EntityDamageEvent::CAUSE_CUSTOM, $damage)); // new EntityDamageEvent(Entity $target, int $cause, float $damage, array $modifiers = [])
So you want an entity attacking another entity? or just an entity being attacked BTW read my edited post XD