# Babel
A **library mod** for Forge 1.20.1 that brings the combat systems of *Arknights* into Minecraft: Elemental Impairment, Life Point, Shield, Physical Defense / Magic Resistance, Difficulty Level, and the Integrated Strategies collectible framework. It is built to be reused by other content mods in the same series.
The jar ships with a playable set of content (collectibles, Cannot, status effects, and more), but **its purpose is to serve as a library, not a standalone gameplay mod**. Most players install it as a dependency for the content mods that rely on it.
- **For mod developers**: `com.susen36.babel.api` exposes hookable events and registration entry points; attributes, capabilities, network sync, HUD, and Jade display are all ready to use.
- **For modpack authors**: every chance, cap, HUD offset, and mod-integration entry can be tuned in the config file.
- **For players**: normally installed as a **dependency**; it can be played on its own to try the bundled content, but the full experience comes from the content mods that depend on it.
---
## Elemental Impairment (EP)
- Five damage types: **Nervous**, **Corrosion**, **Burn**, **Necrosis**, and **Frenzy**, each accumulating and capping independently.
- Filling the bar triggers a burst: the matching debuff is applied and elemental damage is dealt, which can be lethal.
- The HUD supports both an icon bar and a ring, switchable in config with adjustable offsets.
- All values are affected by Elemental Impairment Resistance and damage multipliers, calculated server-side and synced to clients.
## Life Point & Shield
- **Life Point**: a second health bar independent of vanilla health. When a player would take fatal damage, Life Point is consumed first to prevent death; the global cap is configurable.
- **Shield**: a barrier value displayed alongside Life Point, with its own HUD and cap.
- A complete HUD overlay set: Life Point, Shield, Elemental Impairment, Frozen, Paralysis, Sleeping, low-life states, and more.
- Server-authoritative calculation with client-side rendering only, so behavior is consistent in multiplayer.
## Combat Attributes
Nine attributes registered under the `babel` namespace:
| Attribute | Effect |
|---|---|
| `defense` | Physical Defense, used in the damage reduction formula |
| `magic_resistance` | Magic Resistance |
| `elemental_resistance` | Elemental Impairment Resistance |
| `elemental_max_value` | Max Elemental Value |
| `elemental_modifier` | Incoming elemental damage multiplier |
| `physical_missrate` / `magic_missrate` | Physical / Magic MissRate |
| `barrier` | Barrier |
| `max_life_point` | Max Life Point |
Damage reduction and dodge triggers are exposed through events so other mods can hook into them.
## Difficulty
The `difficultyLevel` game rule controls the global difficulty multiplier. `0` disables it, `1–18` enables it, split into five tiers:
| Tier | Range |
|---|---|
| Easy | 0–2 |
| Normal | 3–5 |
| Hard | 6–8 |
| Expert | 9–11 |
| Perilous | 12–18 |
Collectible values, spawn rates, and loot multipliers scale with the tier; switching from a low tier to 9 or above shows a warning.
## Collectibles (Integrated Strategies)
- **Hundreds of collectibles** in four rarities: Normal, Rare, Advanced (can be disabled in config), and Cursed (activated automatically, with a red name).
- Each collectible can have **layers**, a **cooldown**, and a **duration** (default about 8 hours / 24 in-game days).
- Acquisition: loot table injection (30% chance by default), mob and boss drops (bosses always drop Advanced collectibles), and commands.
- A built-in collectible screen (default `C`) shows owned collectibles, layers, and cooldowns.
- Cannot's **Lost and Found** screen lets you exchange owned collectibles for random ones.
## Status Effects
Frozen, Paralysis, Stunned, Silenced, Sleeping, Bound, Feebleness, Under Break, Weightless, Invisible, Physical Dodge, Magic Dodge, Magic Resistance, and more, with matching potions and brewing recipes.
## Cannot & Originium Ingot
- **Cannot**: a merchant who sells collectibles priced in Originium Ingots by rarity. Attacking him triggers a **Robbery** wave fight with a boss bar and phase progress. Wave configs live in `data/babel/robberies/*.json` and can be extended.
- After a Robbery, Cannot ignores that player for a cooldown period (about 90 minutes by default).
- **Originium Ingot**: the base currency item, produced by an entity-death loot modifier with a multiplier that other mods can modify; it can also appear in chests.
---
## Commands
| Command | Permission | Description |
|---|---|---|
| `/collectible give <players> <collectible> [layer]` | 2 | Give a collectible, optionally with layers |
| `/collectible clear <players> <collectible>` | 2 | Remove a collectible |
| `/ep <entities> <type> hurt <amount>` | 2 | Apply Elemental Impairment |
| `/ep <entities> <type> heal <amount>` | 2 | Restore Elemental Impairment |
| `/ep <entities> <type> check` | 0 | Query current Elemental Impairment |
| `/lifepoint <players> life_point <0-255>` | 2 | Set Life Point |
| `/lifepoint <players> max_life_point <1-255>` | 2 | Set Max Life Point |
| `/lifepoint <players> shield <0-999>` | 2 | Set Shield |
Impairment types: `nervous` / `corrosion` / `burn` / `necrosis` / `frenzy`. Collectibles use item IDs, e.g. `babel:omnikey`.
## Game Rules
| Rule | Default | Description |
|---|---|---|
| `difficultyLevel` | `0` | Difficulty Level; `0` disables it, `1–18` enables it |
| `targetLifeFunction` | `true` | Whether the Life Point system is enabled |
## Configuration
Config file: `config/babel-common.toml`, applied after `/reload` or a restart.
| Option | Default | Description |
|---|---|---|
| `ep_icon_style` | `false` | Elemental Impairment HUD style: icon bar or ring |
| `ep_x_offset` / `ep_y_offset` | `0` | Elemental Impairment HUD offset |
| `life_point_x_offset` / `life_point_y_offset` | `0` | Life Point HUD offset |
| `shield_x_offset` / `shield_y_offset` | `0` | Shield HUD offset |
| `initial_life_point` | `6.0` | Initial Life Point |
| `life_point_global_limit` | `32767` | Global Life Point limit |
| `player_shield_global_limit` | `99999` | Global Shield limit |
| `collectible_loot_chance` | `0.3` | Chance for loot tables to inject an extra collectible |
| `collectible_duration_ticks` | `576000` | Collectible duration in ticks |
| `ban_advanced_collectibles` | `false` | Disable Advanced collectibles |
| `robbery_restriction_duration_ticks` | `108000` | How long Cannot ignores a player after a Robbery |
| `wither_elemental_damage` | `true` | Wither attacks apply Necrosis impairment instead |
| `cold_to_frozen` | `true` | Two-stage cold: freezing damage converts into the Frozen effect |
Integration entries such as `hand_strangle_recognizable` and `royal_alliance_treaty_recognizable` accept `*` to match an entire namespace, e.g. `tacz:*`.
## Compatibility
- **Jade** (optional): displays Elemental Impairment, entity resistances, and entity status.
- **JEI**: compile-time dependency only, not required.
- **MixinExtras**: bundled via jarJar, no extra installation needed.
## FAQ
**A collectible does nothing when used?**
Make sure you are not in spectator mode (collectible effects are globally disabled there) and check whether `ban_advanced_collectibles` disabled Advanced collectibles.
**The Elemental Impairment bar does not appear?**
It only shows for entities that have accumulated that impairment type. Verify with `/ep @s nervous hurt 100`, then switch the display style with `ep_icon_style`.
**Players cannot see the HUD or screens on a server?**
The mod must be installed on the client as well; the HUD, screens, and particles are implemented client-side.
---
## For Developers
The **primary purpose of this mod is to be used as a library by other mods**. `com.susen36.babel.api` provides stable event interfaces, and `collectible`, `elemental`, `capability`, and `difficulty` are ready to reuse; the gameplay described above is the bundled reference implementation.
Main events: before/after elemental damage and bursts, Physical Defense and Magic Resistance reduction, dodges, Life Point consumption, collectible use/removal/layer changes, and collectible or Originium Ingot drop resolution on entity death (chance or multiplier can be changed, set to 0 to prevent the drop). Collectibles can be injected from outside via `CollectibleRegisterEvent`, or registered with `CollectibleBuilder` together with rarity, layers, cooldown, and activation effect.
Dependency coordinate (after publishing to the local Maven repository or via JitPack):
```groovy
dependencies {
implementation fg.deobf("com.susen36.babel:babel-lib:1.2.6")
}
```
## License
This project is licensed under **GPL-3.0-or-later**: you may copy, modify, redistribute, or use it commercially, but modified code must be open-sourced under the same license.
## Credits
- Gameplay and numbers inspired by *Arknights* and its Integrated Strategies mode by Hypergryph
- Collectible data: PRTS Wiki, arknights.wiki.gg
- Build scaffolding: Forge MDK, MixinExtras (LlamaLad7), Jade (Snownee)