Undergarden mod !
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user