← Назад к ресурсам

Peak Stamina

A balanced hardcore stamina overhaul featuring many mechanics inspired by the PEAK system. Insanely customizable

Modrinth adventure game-mechanics

Описание

# Peak Stamina Replaces vanilla sprinting mechanics with a resource management system based on fatigue and hunger. comes with compatibility for Tough as Nails, Cold Sweat, ParCool and, Combat roll. For additional custom penalties or integrations, refer to the Advanced Features section below. ---------- ## Features - **Action Costs**: Stamina is drained by sprinting, jumping, attacking, mining, swimming, climbing, and using items. - **Fatigue**: Dropping below 25% stamina and staying there accumulates _Fatigue_, which temporarily reduces your maximum stamina cap. - **Food Poisoning**: Eating bad food applies a lingering _Poison_ penalty (purple bar) that blocks a portion of your max stamina until it decays. - **Weight System**: Carrying heavy items reduces your max stamina. The more you carry, the greater the penalty. - **Climbing**: Ladders consume stamina. Holding **Shift** enables a Slow Climb (40% speed) that costs no stamina and allows gradual regeneration. - **Hunger Penalty**: Low food levels reduce your maximum stamina cap. - **HUD**: A custom, low-profile stamina bar with visual indicators for fatigue, poison, weight, and active penalties. BAR mode ![Peak Stamina BAR HUD](https://media.forgecdn.net/attachments/description/1412640/description_71318891-81ac-4cf2-9c28-13cdc054a439.png) ICON mode ![Peak Stamina ICON HUD](https://media.forgecdn.net/attachments/description/1412640/description_46bf56a5-512b-44fa-b4aa-39bac4ca5020.png) ---------- ## Configuration Files - **`config/peak_stamina/common.toml`**: All core gameplay values (costs, recovery, penalties). - **`config/peak_stamina/lists.toml`**: Weight system, item costs, consumables, universal penalties/buffs, and exhaustion profiles. - **`config/peak_stamina/client.toml`**: HUD and visual settings. - **Note**: With the update v2.0.0 there is now an in game config ui! You can see what it will look like in the gallery. As of update v2.2.0 I will no longer update the description, you can still see some of the older features here in the desc though but it will be missing a lot. ---------- ## Base Settings ### General - `enableStamina` _(Default: `true`)_: Master switch for the mod. - `disableInCreative` _(Default: `true`)_: If true, Creative mode players are excluded from the stamina system entirely. - `disableInSpectator` _(Default: `true`)_: If true, Spectator mode players are excluded from the stamina system entirely. - `initialMaxStamina` _(Default: `100.0`)_: The starting maximum stamina for all players. All penalties and modifiers are calculated against this base value. - `slowClimbSpeed` _(Default: `0.4`)_: The movement speed multiplier when slow climbing (set to 1 to disable) ### Action Costs > Set any value to `0` to disable it. Use a negative value to restore stamina during that action instead of draining it. * `depletionSprint` _(Default: `0.15`)_: Drain per tick while running. * `depletionJump` _(Default: `0.85`)_: Instant drain on jump. * `depletionAttack` _(Default: `3.45`)_: Instant drain on weapon swing. * `depletionMissedAttack` _(Default: `1.0`)_: Instant drain on a missed swing. * `depletionBlockBreak` _(Default: `1.1`)_: Instant drain on block break. * `depletionBlockPlace` _(Default: `1.1`)_: Instant drain on block place. * `depletionClimb` _(Default: `0.7`)_: Drain per tick while on ladders. * `depletionSwim` _(Default: `0.05`_): Drain per tick while in water. * `itemInterruptionCooldown` _(Default: `120`)_: Ticks an item remains unusable after running out of stamina while using it. ### Recovery * `recoveryPerTick` _(Default: `0.36`)_: Base regeneration speed. * `recoveryRestMult` _(Default: `1.45`)_: Multiplier applied when standing still. * `recoveryClimbMult` _(Default: `0.7`)_: Multiplier applied when resting on a ladder. * `recoveryDelay` _(Default: `50`)_: Ticks before regeneration begins after performing an action. ### Enchantments > These values act as multipliers. For example, `0.15` means a 15% reduction, and `0.60` means a 60% reduction. - `lightweightLvl1` _(Default: `0.25`)_: Weight reduction multiplier for the Lightweight I enchantment. - `lightweightLvl2` _(Default: `0.50`)_: Weight reduction multiplier for the Lightweight II enchantment. - `lightweightLvl3` _(Default: `0.75`)_: Weight reduction multiplier for the Lightweight III enchantment. - `tirelessLvl1` _(Default: `0.20`)_: Stamina cost reduction multiplier for the Tireless I enchantment. - `tirelessLvl2` _(Default: `0.40`)_: Stamina cost reduction multiplier for the Tireless II enchantment. - `tirelessLvl3` _(Default: `0.60`)_: Stamina cost reduction multiplier for the Tireless III enchantment. ### Penalties & Limits - `fatigueThreshold` _(Default: `0.25`)_: Stamina percentage at which fatigue begins accumulating. - `fatigueDurationToPenalty` _(Default: `180`)_: Ticks spent in the critical zone before the fatigue penalty activates. - `maxExertionPenalty` _(Default: `30.0`)_: Maximum stamina lost due to fatigue. - `maxHungerPenalty` _(Default: `30.0`)_: Maximum stamina lost due to starvation. - `hungerPenaltyThreshold` _(Default: `6`)_: Food level (3 shanks) at which hunger penalties begin. - `minMaxStamina` _(Default: `10.0`)_: Hard floor for maximum stamina: it can never be reduced below this value. - `penaltyRecoveryDelay` _(Default: `100`)_: Ticks before fatigue begins healing after conditions improve. - `penaltyBuildupRate` _(Default: `0.1`)_: Penalty accumulated per tick when conditions worsen. - `penaltyDecayRate` _(Default: `0.05`)_: Penalty recovered per tick when conditions improve. ---------- ## Intermediate Features ### Sleep Mechanics - `sleepMode` _(Default: `DEFAULT`)_: Controls how fatigue decays: - **`DEFAULT`**: Fatigue decays naturally over time. Sleeping and eating fatigue-curing food both reduce it. - **`HARDCORE`**: Fatigue never decays on its own. You _must_ sleep or eat fatigue-curing food to remove it. - `sleepFatigueReduction` _(Default: `20.0`)_: Flat amount of fatigue penalty removed after a successful sleep. Set to a high number to fully clear it. > **Note:** Only food tagged with `CURE;FATIGUE;value` will cure fatigue. Multiple CURE entries can be chained on a single item: for example, `CURE;FATIGUE;10;CURE;universalpenalty;10` removes 10 points of both. See the Consumables section for a full guide. ---------- ### Combat & Dynamic Weapon Weight **The Weight Scaling Formula:** When weight scaling is enabled, the stamina drained by an attack is multiplied by a calculated weight factor based on the weapon you are holding. `Multiplier = 1.0 + (((WeaponWeight - Normalizer) / Normalizer) * ScaleFactor)` **Hit Attack Settings:** - `depletionAttack` _(Default: `3.45`)_: Base stamina drained per successful attack. - `attackCostScalesWithWeight` _(Default: `true`)_: Enables or disables the dynamic weight formula for successful hits. - `attackWeightNormalizer` _(Default: `3.0`)_: The baseline weapon weight that results in exactly a 1.0x stamina cost multiplier. - `attackWeightScaleFactor` _(Default: `1.0`)_: How intensely weight affects the attack cost. - `attackWeightMinMultiplier` _(Default: `0.4`)_: The absolute minimum stamina cost multiplier. - `attackWeightMaxMultiplier` _(Default: `5.0`)_: The absolute maximum stamina cost multiplier. **Missed Attack Settings:** - `depletionMissedAttack` _(Default: `1.0`)_: Base stamina drained when swinging at the air. - `missedAttackCostScalesWithWeight` _(Default: `true`)_: Enables or disables the dynamic weight formula for missed attacks. - `missedAttackWeightNormalizer` _(Default: `3.0`)_: The baseline weapon weight for a 1.0x multiplier on missed attacks. - `missedAttackWeightScaleFactor` _(Default: `1.0`)_: How intensely weight affects the missed attack cost. - `missedAttackWeightMinMultiplier` _(Default: `0.4`)_: The minimum possible stamina cost multiplier for missed attacks. - `missedAttackWeightMaxMultiplier` _(Default: `5.0`)_: The maximum possible stamina cost multiplier for missed attacks. ---------- ### Elytra Mechanics Controls what happens when a player runs out of stamina while flying. - `depletionElytra` _(Default: `0.25`)_: Drain per tick while flying. - `disableElytraWhenExhausted` _(Default: `true`)_: If true, the Elytra will aerodynamically stall when stamina hits 0. If false, flight continues normally. - `exhaustedElytraDrag` _(Default: `0.86`)_: Horizontal speed retained per tick during a stall. Lower = faster deceleration. (`0.9` = 10% speed loss per tick.) - `exhaustedElytraGravity` _(Default: `-0.025`)_: Extra vertical gravity per tick during a stall. Negative values pull the player downward. - `exhaustedElytraMinSpeed` _(Default: `0.5`)_: Speed threshold below which the Elytra force-closes and drops the player. - `exhaustedElytraTickInterval` _(Default: `3`)_: How often in ticks drag physics are applied. `1` = every tick. ---------- ### Bonus Stamina Controls how players earn bonus stamina and how it decays over time. When Bonus Stamina exceeds your maximum capacity, the HUD bar dynamically stacks on top of itself. Each overflow tier is shaded slightly darker, and a multiplier label (e.g., `2x`, `3x`) appears on the left side of the bar. - `enableExcessStaminaConversion` _(Default: `true`)_: If true, restoring stamina past the max via consumables converts the overflow into Bonus Stamina. - `excessConversionRate` _(Default: `0.5`)_: Percentage of excess converted. `0.5` = 50% (e.g., 10 overflow → 5 Bonus Stamina). - `bonusStaminaDecayDelay` _(Default: `20`)_: Ticks before Bonus Stamina begins decaying after being gained or used. (20 ticks = 1 second.) - `bonusDecayScalesWithAmount` _(Default: `true`)_: If true, decay is a percentage of current bonus stamina: it burns faster when you have more. If false, decay is a flat amount. - `bonusStaminaDecayRate` _(Default: `0.05`)_: Bonus Stamina lost per second. With scaling enabled, `0.05` = 5% per second. ---------- ## Advanced Features > Advanced configuration is located in `config/peak_stamina/lists.toml`. ---------- ### Weight System Tracks the total weight of items in your inventory and applies a stamina penalty when you carry too much. Penalty scales linearly between the threshold and the limit. - `enableWeightSystem` _(Default: `true`)_: Enable or disable weight calculations. - `weightPenaltyThreshold` _(Default: `125.0`)_: Total weight at which the penalty begins (0%). - `weightPenaltyLimit` _(Default: `400.0`)_: Total weight at which the penalty reaches maximum (100%). - `maxWeightPenaltyAmount` _(Default: `40.0`)_: Maximum stamina reduction at full weight. - `maxWeightRecursionDepth` _(Default: `3`)_: How many levels deep to scan nested containers. - `autoWeightBase` _(Default: `10.0`)_: Base weight for items not explicitly listed. #### How Weights Are Calculated Every item's weight is determined by one of four priority tiers (highest wins): 1. **Explicit Item Weights**: defined in `customItemWeights` (Supports standard IDs and Virtual NBT IDs). 2. **Tag Weights**: defined in `customTagWeights`. 3. **Advanced NBT Extraction**: defined in `nbtWeightPaths` (Extracts hidden IDs to check against explicit weights). 4. **Auto-Weigher**: heuristic fallback: `Weight = (autoWeightBase / MaxStackSize) × Count`. With `autoWeightBase = 10.0`, a sword (stack 1), 16 Ender Pearls, and 64 dirt blocks all weigh 10.0 total: carrying more of a stackable item doesn't multiply weight indefinitely. Containers (shulker boxes, backpacks) include the weight of their contents. Shulker Boxes, Curios, and PackedUp are supported automatically. #### Explicit Item Weights **Format:** `"modid:item;weight"`: weight is per individual item, not per stack. _Note: This list also accepts "Virtual IDs" extracted by the Advanced NBT system (e.g., `"tacz:9mm;0.05"`)._ ``` customItemWeights = [ "minecraft:netherite_chestplate;15.0", "minecraft:diamond_sword;4.0", "minecraft:obsidian;1.2", "tacz:9mm;0.05" ] ``` #### Tag Weights **Format:** `"tag;weight"`: weight applies to each individual item within the tag. ``` customTagWeights = [ "forge:ores;0.25", "forge:storage_blocks;0.15", "forge:ingots;0.2" ] ``` #### Custom Container Paths For backpack mods that store items in custom NBT. Only needed if a mod isn't detected automatically. **Format:** `"modid:item;path.to.list"` ``` customContainerPaths = [ "somemod:satchel;Inventory", "anothermod:backpack;StorageTag.Items" ] ``` #### Advanced NBT Weight Extraction (For Complex Mods) **WHEN TO USE THIS:** Most items in Minecraft use a standard Item ID (e.g., `minecraft:apple`). For those, you do NOT need this list; just put them directly into the Explicit Item Weights list. However, some complex mods (like TACZ) use a single base item (e.g., `tacz:ammo`) and store the actual specific item ID (like `tacz:9mm`) hidden inside NBT folders. This list tells the weight system exactly where to look inside the NBT data to find that true "Virtual ID". **WHERE TO PUT THE IDS:** Once you define a path here, the weight system will extract the hidden Virtual ID. You must then put that extracted ID into your `Explicit Item Weights` list to assign it a weight. **Format:** `"base_item_id ; nbt.path.to.id ; fallbackWeight ; applyFallbackIfMissing"` **Examples:** ``` nbtWeightPaths = [ # Example 1: Ammo (Uses 'true' for the fallback flag) # Looks inside 'tacz:ammo' for 'AmmoId'. If it finds an ID like 'tacz:9mm', it checks Explicit Weights. # If 'tacz:9mm' isn't explicitly configured, it adds 0.05 weight. # If the AmmoId tag is missing entirely, it still adds 0.05 because the flag is true. "tacz:ammo;AmmoId;0.05;true", # Example 2: Attachments (Uses 'false' for the fallback flag) # Digs through a gun's NBT folders (opens AttachmentSCOPE, then tag, to read AttachmentId) to check for a scope. # If a scope is found, it checks Explicit Weights, else adds 0.5. # If no scope is equipped (the folder is empty), it adds 0.0 weight because the flag is false. # (If it was true, it would add 0.5 phantom weight even if the gun had no scope. So false is better here) "tacz:modern_kinetic_gun;AttachmentSCOPE.tag.AttachmentId;0.5;false" ] ``` #### Weight Limit Attribute Increase a player's carry capacity with `/stamina attr weight_limit `. Each point adds `+0.5` to the threshold and `+1.0` to the limit. ---------- ### Item Depletion Costs Assign stamina costs to any item. Multiple cost types can be stacked on a single item (e.g., a shield that drains stamina both to hold and to block with). > Use a negative cost value to restore stamina during the action instead of draining it. - `itemInterruptionCooldown` _(Default: `80`)_: Cooldown in ticks if you run out of stamina while using an item. - `enableAttackCooldownWhenExhausted` _(Default: `false`)_: Different from `itemInterruptionCooldown` this one targets weapons, swords, axes, etc. - `exhaustedAttackCooldownDuration` _(Default: `80`)_: How long the cooldown for weapons is when swung while out of stamina. **Format:** `"ItemId;TYPE;Cost;TYPE;Cost..."` **Cost types:** - `TICK`: Drains stamina continuously while the item is in use. Cancels the action if stamina hits 0. - `BLOCK`: Drains stamina only when a Shield successfully blocks damage. Supports dynamic scaling: `BLOCK;BaseCost;DamageMultiplier`. - `USE`: Drains stamina instantly on right-click. - `USE_ON_BLOCK`: Drains stamina only when the tool successfully modifies a block state. **Examples:** ``` # Shield: `0.2/tick` to hold; when hit, `2.0` flat + `80%` of incoming damage: "minecraft:shield;TICK;0.2;BLOCK;2.0;0.8" # Bow: `0.5/tick` to draw: "minecraft:bow;TICK;0.5" # Fishing Rod: `3.0` stamina to cast: "minecraft:fishing_rod;USE;3.0" ``` > A tag based list is also available using the same format, with a tag ID instead of an item ID. Specific item entries always take priority over tag entries. ---------- ### Consumables System Chain multiple effects onto a single item to create complex food and consumable interactions. - `penaltyReliefDuration` _(Default: `25`)_: Seconds the _Resistance_ buff lasts after eating a relief item. - `maxPoisonPenalty` _(Default: `40.0`)_: Maximum stamina blocked by food poisoning. - `poisonDecayDelay` _(Default: `45`)_: Seconds after eating before the poison penalty begins to heal. - `poisonDecayRate` _(Default: `0.05`)_: How fast the poison bar drains after the delay expires. **Format:** `"ItemId;TYPE;Args...;TYPE;Args..."` **Effect types:** - `INSTANT;Amount`: Instantly restores `Amount` stamina. - `BONUS;Amount`: Grants `Amount` Bonus Stamina (gold bar). Consumed before normal stamina and decays over time. - `POISON;Amount`: Applies a food poisoning penalty (purple bar) of `Amount`. Decays after `poisonDecayDelay` seconds. - `REGEN;Amount;Seconds`: Modifies regen speed for `Seconds`. Positive = faster, negative = slower. (`0.2 = +20%`, `-0.3 = -30%.`) - `PENALTY;Amount`: Grants _Resistance_ for `penaltyReliefDuration` seconds. Formula: **30% base + (Amount / 100)**. Caps at 80%. - `CURE;Target;Amount`: Removes `Amount` from a specific penalty. Valid targets: `FATIGUE`, `HUNGER`, `POISON`, `WEIGHT`, `ALL`, or any custom key (e.g., `temperature` or `modid:effectid`). **Examples:** ``` # Restores 10.0 stamina and grants 5.0 Bonus Stamina. "minecraft:apple;INSTANT;10.0;BONUS;5.0" # Grants ~50% Resistance to penalty gain for the configured relief duration. "minecraft:golden_carrot;PENALTY;20.0" # Removes 100.0 points of Food Poisoning. "minecraft:milk_bucket;CURE;POISON;100.0" # Removes 50.0 Poison and 20.0 Fatigue. "modid:herbal_tea;CURE;POISON;50.0;CURE;FATIGUE;20.0" # Removes 100.0 points of penalty caused by the Wither Effect. "minecraft:honey_bottle;CURE;minecraft:wither;100.0" # Removes 50.0 from all active penalties and grants ~55% Resistance. "minecraft:golden_apple;CURE;ALL;50.0;PENALTY;25.0" ``` ---------- ### Exhaustion Penalties Define what happens when a player's stamina hits 0. - `exhaustionCooldownDuration` _(Default: `60`)_: Ticks (3 seconds) the penalties persist after hitting 0. - `exhaustedSpeedPenalty` _(Default: `-0.65`)_: Sprint speed reduction when running at 0 stamina. Players will not regenerate stamina while doing this. - `customExhaustionPenalties`: A list of attribute modifiers applied at exhaustion. **Format:** `"AttributeName;Amount;Operation"` Operations: `0` = Add flat, `1` = Multiply base, `2` = Multiply total. Example: slow the player by 15%: ``` "minecraft:generic.movement_speed;-0.15;2" ``` ---------- ### Universal Penalties (NBT & Status Effects) Link any mod's data: thirst, temperature, radiation, magic: to the stamina system using comparators. Supports gradual buildup or instant application. - `universalPenalties`: The list of rules defining external penalties. - `showIcons` _(Default: `true`)_: Toggle penalty icons on the HUD. _(Located in `peak_stamina-client.toml`. Check your version's config comments for availability.)_ **Format:** `"Type;Key;Comparator;Threshold;WorstValue;MaxPenalty;ColorInt;IconText"` | Parameter |Description | | ---------- |--------------------------------------------------------------------------------------------------------------------- | | Type |NBT (checks player data) or EFFECT (checks potion amplifier/level). | | Key |The NBT path (e.g., thirstLevel) or Effect ID (e.g., minecraft:poison). | | Comparator |Logic for calculating the penalty. See comparator modes below. | | Threshold |The safe value where penalty starts (0%). | | WorstValue |In SCALE mode: The value where penalty reaches 100%.In MULTIPLIER mode: The Maximum total penalty allowed (Hard Cap). | | MaxPenalty |In SCALE mode: Total penalty amount at WorstValue.In MULTIPLIER mode: Penalty amount per 1 unit of difference. | | ColorInt |Decimal color code for the HUD overlay (e.g., 16711680 is Red). | | IconText |Emoji or text to display on the bar. Write none to disable. > `EFFECT` checks the amplifier, not the displayed level. Amplifier `0` = Level I. #### Comparator Modes | Operator | Behavior | | :--- | :--- | | `>` | Linear penalty as value rises above Threshold, maxing at WorstValue. | | ` `BurstAmount` is exclusive to `BOTH` modes. `ScalingFactor` is exclusive to `MULTIPLIER` modes. **Action Modes:** | Action Mode | Behavior | | :--- | :--- | | `PASSIVE_OVER` / `PASSIVE_UNDER` | Regenerates Bonus Stamina per second while the stat is above/below Threshold. | | `BURST_OVER` / `BURST_UNDER` | Instantly grants Bonus Stamina once when the stat crosses Threshold. | | `BOTH_OVER` / `BOTH_UNDER` | Grants a one-time burst when crossing Threshold, then regenerates passively up to the hardcap. | Append `_MULTIPLIER` to any mode (e.g., `PASSIVE_OVER_MULTIPLIER`) to scale the effect based on how far past the threshold the player is. `LimitOrCooldown` is context dependent: for PASSIVE/BOTH modes it sets the Bonus Stamina hardcap; for BURST modes it sets the cooldown in ticks before the burst can re-trigger. **Examples:** **Passive (Regeneration Effect):** ```toml # Generates 1.0/sec while active, cap 20.0 "EFFECT;minecraft:regeneration;PASSIVE_OVER;-1;20.0;1.0" ``` **Burst + Passive (NBT Mana Stat):** ```toml # Burst of 30.0 when mana exceeds 50, then 2.0/sec passively up to cap 100.0 "NBT;player_mana;BOTH_OVER;50;100.0;2.0;30.0" ``` **Multiplier (Strength Effect):** ```toml # Strength I (Amp 0): 1.25x -> 2.5/sec, cap 25.0 # Strength II (Amp 1): 1.50x -> 3.0/sec, cap 30.0 "EFFECT;minecraft:strength;PASSIVE_OVER_MULTIPLIER;-1;20.0;2.0;1.25" ``` #### Nested NBT Paths Use `.` to navigate inside nested NBT tags, chaining as many levels as needed: ``` # ForgeCaps tag → legendarysurvivaloverhaul:thirst tag → hydrationLevel value "ForgeCaps.legendarysurvivaloverhaul:thirst.hydrationLevel" # ForgeCaps tag → legendarysurvivaloverhaul:temperature tag → temperature value "ForgeCaps.legendarysurvivaloverhaul:temperature.temperature" # ForgeCaps tag → somemod:player_stats tag → skills tag → mining_level value "ForgeCaps.somemod:player_stats.skills.mining_level" ``` > **Troubleshooting:** If the correct path still doesn't work, try prefixing with `ForgeCaps.` followed by the rest of the path. Example: `"NBT;ForgeCaps.legendarysurvivaloverhaul:temperature.temperature;*