Skip to content

Commit 844a53a

Browse files
Add Armor Stats Documentation + fix up others
1 parent 5901f5e commit 844a53a

File tree

4 files changed

+50
-39
lines changed

4 files changed

+50
-39
lines changed

docs/.vitepress/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export default defineConfig({
4141
collapsed: false,
4242
items: [
4343
{ text: 'Introduction to Patch Generators', link: '/defaulted/patch-gens/introducing-patch-gens' },
44+
{ text: `Armor Stats Generator`, link: '/defaulted/patch-gens/armor-stats'},
4445
{ text: `Vanilla Weapon Stats Generator`, link: '/defaulted/patch-gens/weapon-stats'},
4546
{ text: `Combat Test Weapon Stats Generator`, link: '/defaulted/patch-gens/combat-test-weapon-stats'}
4647
]
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Armor Stats Generator
3+
---
4+
5+
# Armor Statistics Modification and You
6+
7+
First off, let's define what this generator is, and does.
8+
The primary purpose of this generator is for modifying armor stats in a vanilla-like manner, based on the equipment slot the item goes in.
9+
10+
This will produce a `minecraft:attribute_modifiers` component, as well as `minecraft:max_damage`.
11+
This generator has the id `defaulted:armor_stats`.
12+
13+
The following is an introduction to how to use it:
14+
15+
First off, mark whether it should maintain the previous attribute modifiers on top of its new ones.
16+
17+
This is defined with a boolean with the name `persist_previous`.
18+
19+
In addition, there are four fields which this generator will take:
20+
1. `max_damage`: The durability of the item, taking the form of an [armor variable](#armor-variable) of type integer.
21+
2. `armor`: The armor of the item, taking the form of an [armor variable](#armor-variable) of type integer.
22+
3. `armor_toughness`: The armor toughness of the item, taking the form of an [armor variable](#armor-variable) of type double.
23+
4. `knockback_resistance`: The knockback resistance of the item, taking the form of an [armor variable](#armor-variable) of type double.
24+
25+
<a id="armor-variable"></a>
26+
## Armor Variable Codecs
27+
28+
The specific expected inputs for each field depends on where specifically it is used.
29+
Armor Variable values represent each possible armor slot and will choose a value based on what the armor they are being parsed for goes into.
30+
31+
If in object form, is decoded as the following:
32+
1. `helmet`: The value for all armors which go in the head slot.
33+
2. `chestplate`: The value for all armors which go in the chest slot.
34+
3. `leggings`: The value for all armors which go in the leggings slot.
35+
4. `boots`: The value for all armors which go in the feet slot.
36+
5. `body`: The value for all armors which go in the body slot (typically used for non-humanoid mobs).
37+
6. `any`: The fallback value for the armor, can provide for any non-specified ones.
38+
All Armor Variables can be written as a singular form of their expected value, becoming only the fallback.

docs/defaulted/patch-gens/combat-test-weapon-stats.md

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,10 @@ The primary purpose of this generator is for modifying weapon stats in a combat-
1111
> This patch generator ONLY EXISTS with Combatify installed.
1212
1313
This will produce a `minecraft:attribute_modifiers` component.
14+
This generator has the id `defaulted:combat_test_weapon_stats`.
1415

1516
The following is an introduction to how to use it:
1617

17-
:::details Pseudocode
18-
```json
19-
{
20-
...
21-
"patch_generators": [
22-
{
23-
"generator": "defaulted:combat_test_weapon_stats",
24-
...
25-
}
26-
]
27-
...
28-
}
29-
```
30-
:::
31-
3218
First off, mark whether it should maintain the previous attribute modifiers on top of its new ones.
3319

3420
This is defined with a boolean with the name `persist_previous`.

docs/defaulted/patch-gens/weapon-stats.md

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,10 @@ First off, let's define what this generator is, and does.
88
The primary purpose of this generator is for modifying weapon stats in a vanilla-expected manner.
99

1010
This will produce a `minecraft:attribute_modifiers` component.
11+
This generator has the id `defaulted:vanilla_weapon_stats`.
1112

1213
The following is an introduction to how to use it:
1314

14-
:::details Pseudocode
15-
```json
16-
{
17-
...
18-
"patch_generators": [
19-
{
20-
"generator": "defaulted:vanilla_weapon_stats",
21-
...
22-
}
23-
]
24-
...
25-
}
26-
```
27-
:::
28-
2915
First off, mark whether it should maintain the previous attribute modifiers on top of its new ones.
3016

3117
This is defined with a boolean with the name `persist_previous`.
@@ -95,13 +81,13 @@ The ids for the damage and speed modifiers can be overridden with `damage_id_ove
9581
## Weapon-Level-Based Values
9682

9783
If in object form, requires field `type`. Can have the following values, `constant`, `lookup`, and `linear`
98-
* Constant has the following fields:
99-
1. `value`: A floating-point value.
100-
2. `applies_additional`: Whether to apply a bonus provided to it, tier damage in the case of attack damage, 0 otherwise.
101-
* Lookup has the following fields:
102-
1. `values`: A list of level-matching conditions, which themselves are an object with two fields: a weapon-level-based value of name `value` (taking the same form seen here), and a level condition named `condition`, of a `type` either `clamped`, which takes an integer `min` and integer `max`, and will be satisfied for all numbers between the two (inclusive), or a type `list`, which is a list of accepted levels to match.
103-
2. `fallback`: A weapon-level-based value which will be used in the case no value matches.
104-
* Linear has the following fields:
105-
1. `base`: A weapon-level-based value which will be the base.
106-
2. `per_level_above_first`: The weapon-level-based value to add to the base for each level above the first.
84+
* Constant has the following fields:
85+
1. `value`: A floating-point value.
86+
2. `applies_additional`: Whether to apply a bonus provided to it, tier damage in the case of attack damage, 0 otherwise.
87+
* Lookup has the following fields:
88+
1. `values`: A list of level-matching conditions, which themselves are an object with two fields: a weapon-level-based value of name `value` (taking the same form seen here), and a level condition named `condition`, of a `type` either `clamped`, which takes an integer `min` and integer `max`, and will be satisfied for all numbers between the two (inclusive), or a type `list`, which is a list of accepted levels to match.
89+
2. `fallback`: A weapon-level-based value which will be used in the case no value matches.
90+
* Linear has the following fields:
91+
1. `base`: A weapon-level-based value which will be the base.
92+
2. `per_level_above_first`: The weapon-level-based value to add to the base for each level above the first.
10793
All weapon-level-based values mentioned above can either be in object form or as a single floating-point value resolving to a constant.

0 commit comments

Comments
 (0)