Physical and arcane damage

This commit is contained in:
2026-09-30 09:56:53 -03:00
parent 88659bb7af
commit 9e580f175e
9 changed files with 54 additions and 75 deletions
+8 -2
View File
@@ -63,7 +63,13 @@ export abstract class Mob extends LivingEntity {
jump_control = new JumpControl(this);
override default_attributes(): [AttributeType, number?][] {
return [...super.default_attributes(), [ATTRIBUTES.follow_range, 16], [ATTRIBUTES.attack_knockback]];
return [
...super.default_attributes(),
[ATTRIBUTES.follow_range, 16],
[ATTRIBUTES.attack_knockback],
[ATTRIBUTES.physical_shielding],
[ATTRIBUTES.arcane_shielding],
];
}
#registered_goals = false;
@@ -161,7 +167,7 @@ export abstract class Mob extends LivingEntity {
// hits whoever it's attacking with its attack damage, like minecraft's doHurtTarget. returns whether it hurt them
do_hurt_target(target: Entity | PlayerTarget): boolean {
const damage = this.attribute(ATTRIBUTES.attack_damage);
const source = { cause: "mob_attack", attacker: this };
const source = { cause: "mob_attack", attacker: this, type: "physical" } as const;
if (!(target instanceof Entity)) {
this.level.damage_player(target.id, damage, source);
return true;