Undergarden mod !

This commit is contained in:
2026-09-30 17:30:14 -03:00
parent cbc9edfd60
commit 0052faa24d
21 changed files with 545 additions and 46 deletions
+7
View File
@@ -57,6 +57,9 @@ export abstract class Mob extends LivingEntity {
target_goals = new GoalSelector();
// who it's after, set by target goals
target: LivingEntity | undefined;
// who hurt it last, and how many times something has, for HurtByTargetGoal
last_attacker: LivingEntity | undefined;
times_hurt_by_attacker = 0;
move_control = new MoveControl(this);
look_control = new LookControl(this);
@@ -109,6 +112,10 @@ export abstract class Mob extends LivingEntity {
override on_hurt(source: DamageSource) {
super.on_hurt(source);
this.no_action_time = 0;
if (source.attacker instanceof LivingEntity && source.attacker !== this) {
this.last_attacker = source.attacker;
this.times_hurt_by_attacker += 1;
}
}
// despawning