Giant chesplate

This commit is contained in:
2026-10-01 16:58:30 -03:00
parent a7835261e1
commit 1fc92a7b00
21 changed files with 148 additions and 51 deletions
+8
View File
@@ -104,6 +104,12 @@ export abstract class LivingEntity extends Entity {
this.#health = Math.min(this.max_health, Math.max(0, value));
}
// health from a save. it can be over max_health until the next tick, so max_health modifiers given back while
// loading, like worn curios', keep it
load_health(value: number) {
this.#health = Math.max(0, value);
}
get dead() {
return this.#health <= 0;
}
@@ -439,6 +445,8 @@ export abstract class LivingEntity extends Entity {
}
tick_effects() {
// like minecraft, losing max health, like a max_health modifier going away, takes the health over it
if (this.#health > this.max_health) this.#health = this.max_health;
for (const effect of [...this.effects.values()]) {
if (this.effects.get(effect.type.id) !== effect) continue;
const result = effect.tick(this);