Giant chestplate regeneration passive

This commit is contained in:
2026-10-01 18:16:03 -03:00
parent f2c3cb8135
commit 8396e8e895
9 changed files with 168 additions and 8 deletions
+1 -1
View File
@@ -48,7 +48,7 @@ showed. These events fire for **every** player's actions, since they all go thro
| `block_place` | ✓ | ✓ | `player`, `block` (`{ id, x, y, z }`), `face` clicked, `item` held |
| `block_interact` | ✓ | ✓ | `player`, `block`, `item` held. Before fires for every right click on a block, after only when a component's `on_interact` handled it |
| `chat_send` | ✓ | ✓ | `player`, `message`. Before handlers can change `message` |
| `player_damage` | ✓ | | `player`, `amount`, `cause`. Before handlers can change `amount` |
| `player_damage` | ✓ | ✓ | `player`, `amount`, `cause`. Before handlers can change `amount`, after fires only when they were hurt, with what they took |
| `player_death` | | ✓ | `player`, `cause`. They've dropped what they carried and respawn right after |
| `player_join` | | ✓ | `player` |
| `player_leave` | | ✓ | `player` |
+22
View File
@@ -42,6 +42,10 @@ interface Player {
attribute(id: string): number;
add_modifier(attribute: string, modifier: AttributeModifier): void;
remove_modifier(attribute: string, id: string): boolean;
add_effect(id: string, duration: number, options?: EffectOptions): void;
effect(id: string): { amplifier: number; duration: number } | undefined;
remove_effect(id: string): boolean;
}
```
@@ -93,6 +97,24 @@ Like Minecraft, an attack right after the last one, or right after changing the
damage, rising to full after `20 / attack_speed` ticks. A bar under the crosshair shows it filling up, and the server
sends players their `attack_speed` whenever it changes so the bar matches.
## Status Effects
Players have Minecraft's status effects: `bworld:speed`, `bworld:slowness`, `bworld:strength`, `bworld:weakness`,
`bworld:jump_boost`, `bworld:health_boost`, `bworld:regeneration`, `bworld:poison`, `bworld:wither`,
`bworld:instant_health`, `bworld:instant_damage`, `bworld:resistance`, `bworld:fire_resistance`,
`bworld:water_breathing`, `bworld:slow_falling` and `bworld:glowing`.
```ts
player.add_effect("bworld:regeneration", 100, { amplifier: 1 }); // regeneration II for 5 seconds
player.effect("bworld:regeneration"); // { amplifier: 1, duration: 100 }
player.remove_effect("bworld:regeneration");
```
`duration` is in ticks, `-1` for forever. `amplifier` is the level minus 1. The options also take `ambient`,
`show_particles` and `show_icon`. Like Minecraft, adding an effect they already have keeps the stronger one, and a
weaker one that lasts longer waits under it, taking over when the stronger one runs out. A player's effects aren't
saved: they're gone when the player leaves, and when they die.
## Worn Items
`set_worn(key, items)` says what a mod shows on a player, like the base game's curios slots do for what's in them. Each