Physical and arcane damage

This commit is contained in:
2026-09-30 09:56:53 -03:00
parent 88659bb7af
commit 9e580f175e
9 changed files with 54 additions and 75 deletions
+4 -1
View File
@@ -98,6 +98,9 @@ export interface EntityJson {
max_health?: number;
// minecraft's per tick speed, 0.25 for most animals
movement_speed?: number;
// protection from physical and from arcane damage, not used yet
physical_shielding?: number;
arcane_shielding?: number;
}
type Vec3 = [number, number, number];
@@ -678,7 +681,7 @@ export function validate_entity(json: unknown): Problems {
problems.push(`${key} must be a number of blocks above 0, at most 16`);
}
}
for (const key of ["max_health", "movement_speed"]) {
for (const key of ["max_health", "movement_speed", "physical_shielding", "arcane_shielding"]) {
if (json[key] !== undefined && (typeof json[key] !== "number" || json[key] < 0)) {
problems.push(`${key} must be a number, 0 or more`);
}