Physical and arcane damage
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user