tutorial:damagetypes
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| tutorial:damagetypes [2023/09/03 08:29] – Add notice of non-intermediary names hiisuuii | tutorial:damagetypes [2023/09/24 18:53] (current) – Use new minecraft wiki mattidragon | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | FIXME This page contains non-Intermediary named references to classes and fields. The wiki's map2fabricyarn plugin must be updated to current mappings before these references can be renamed to Intermediary. | ||
| ====== Adding a Damage Type (1.19.4+) ====== | ====== Adding a Damage Type (1.19.4+) ====== | ||
| Line 9: | Line 8: | ||
| ==== Creating a Damage Type ==== | ==== Creating a Damage Type ==== | ||
| - | First, create a json file for your custom damage type following the format [[https:// | + | First, create a json file for your custom damage type following the format [[https:// |
| <code json data/ | <code json data/ | ||
| { | { | ||
| Line 18: | Line 17: | ||
| </ | </ | ||
| - | Our new custom damage type will now cause 0.1 [[https:// | + | Our new custom damage type will now cause 0.1 [[https:// |
| ==== Getting our damage type in code ==== | ==== Getting our damage type in code ==== | ||
| Line 27: | Line 26: | ||
| /* | /* | ||
| - | * Store the class_5321 of our DamageType | + | * Store the class_5321 of our class_8110 |
| * The class_2960 in use here points to our JSON file we created earlier. | * The class_2960 in use here points to our JSON file we created earlier. | ||
| */ | */ | ||
| - | public static final class_5321< | + | public static final class_5321< |
| - | public static class_1282 of(class_1937 world, class_5321< | + | public static class_1282 of(class_1937 world, class_5321< |
| - | return new class_1282(world.method_30349().method_30530(class_7924.DAMAGE_TYPE).method_40290(key)); | + | return new class_1282(world.method_30349().method_30530(class_7924.field_42534).method_40290(key)); |
| } | } | ||
| } | } | ||
| </ | </ | ||
| - | Our static method '' | + | Our static method '' |
| ==== Using our damage type ==== | ==== Using our damage type ==== | ||
| Line 57: | Line 56: | ||
| } | } | ||
| </ | </ | ||
| - | You'll notice that ''< | + | You'll notice that ''< |
| Now whenever a ``<yarn class_1309> | Now whenever a ``<yarn class_1309> | ||
| Line 89: | Line 88: | ||
| | avoids_guardian_thorns | Does not trigger the Thorns effect when attacking Guardians | | | | avoids_guardian_thorns | Does not trigger the Thorns effect when attacking Guardians | | | ||
| | burns_armor_stands | Deals a flat 4.0 damage to armor stands | | | | burns_armor_stands | Deals a flat 4.0 damage to armor stands | | | ||
| - | | bypasses_armor | Ignores all armor protection value | | | + | | bypasses_armor | Ignores all armor base protection value. Does not ignore Protection enchantments. |
| | bypasses_effects | Bypasses both Resistance effect and Protection enchantments, | | bypasses_effects | Bypasses both Resistance effect and Protection enchantments, | ||
| - | | bypasses_enchantments | Ignores all types of Protection enchantments | | | + | | bypasses_enchantments | Ignores all types of Protection enchantments, but not base armor protection. |
| | bypasses_invulnerability | Damages players who are invulnerable, | | bypasses_invulnerability | Damages players who are invulnerable, | ||
| | bypasses_resistance | Bypasses Resistance effect | | | | bypasses_resistance | Bypasses Resistance effect | | | ||
tutorial/damagetypes.1693729792.txt.gz · Last modified: 2023/09/03 08:29 by hiisuuii