Make players mobs too !
This commit is contained in:
@@ -331,6 +331,22 @@ export abstract class LivingEntity extends Entity {
|
||||
this.health -= post_mitigation;
|
||||
}
|
||||
|
||||
// back to full health with nothing left over from before: no effects, fire, hurt cooldown or who hurt it. for
|
||||
// players respawning, minecraft makes them a new entity instead
|
||||
revive() {
|
||||
this.clear_effects();
|
||||
this.health = this.max_health;
|
||||
this.fire = 0;
|
||||
this.air = this.max_air;
|
||||
this.fall_distance = 0;
|
||||
this.vx = this.vy = this.vz = 0;
|
||||
this.hurt_time = this.death_time = 0;
|
||||
this.#hurt_cooldown = 0;
|
||||
this.#last_hurt_amount = 0;
|
||||
this.last_hurt_by_mob = this.last_hurt_by_player = undefined;
|
||||
this.ticks_since_last_hurt_by_mob = this.last_hurt_by_player_memory_time = 0;
|
||||
}
|
||||
|
||||
// it was just hurt, for kinds that react
|
||||
on_hurt(_source: DamageSource) {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user