Curios and artifacts !

This commit is contained in:
2026-09-30 15:22:32 -03:00
parent 342b45d593
commit 3af5f6e54b
45 changed files with 729 additions and 43 deletions
+4 -2
View File
@@ -2,7 +2,7 @@
// numbers are minecraft's, so movement_speed is its per tick value, see LivingEntity.travel
export type ModifierOperation = "add_value" | "add_multiplied_base" | "add_multiplied_total";
const OPERATIONS: ModifierOperation[] = ["add_value", "add_multiplied_base", "add_multiplied_total"];
export const MODIFIER_OPERATIONS: ModifierOperation[] = ["add_value", "add_multiplied_base", "add_multiplied_total"];
export interface AttributeModifier {
// unique on the attribute, so it can be replaced or taken off, like "bworld:effect.speed"
@@ -31,6 +31,8 @@ export const ATTRIBUTES = {
movement_speed: attribute("movement_speed", 0.7, 0, 1024),
attack_damage: attribute("attack_damage", 2, 0, 2048),
attack_knockback: attribute("attack_knockback", 0, 0, 5),
// full strength attacks a second, see ServerPlayer.attack_strength
attack_speed: attribute("attack_speed", 4, 0, 1024),
// how far mobs notice players from, in blocks
follow_range: attribute("follow_range", 32, 0, 2048),
// how fast a jump starts, blocks per tick
@@ -167,7 +169,7 @@ export class AttributeMap {
for (const modifier of Array.isArray(entry.modifiers) ? entry.modifiers : []) {
if (
typeof modifier?.id === "string" && typeof modifier.amount === "number" &&
OPERATIONS.includes(modifier.operation)
MODIFIER_OPERATIONS.includes(modifier.operation)
) {
attribute.add_modifier(modifier);
}