tutorial:armor
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tutorial:armor [2022/06/24 07:17] – Remove [Adding Knockback Protection] as FAPI 0.55.1 obsoletes it daomephsta | tutorial:armor [2023/08/20 10:19] (current) – [Texturing] wjz_p | ||
---|---|---|---|
Line 92: | Line 92: | ||
==== Creating Armor Items ==== | ==== Creating Armor Items ==== | ||
- | We're gonna make a new class called RegisterItems to implement your new armor pieces. This will also be the place to, for example, register tools, if you're making a new item like an ingot (We'll refer to this as a " | + | We're gonna make a new class called RegisterItems to implement your new armor pieces. This will also be the place to, for example, register tools, if you're making a new item like an ingot (We'll refer to this as a " |
- | + | ||
- | The syntax of groups is //.<yarn method_7892> | + | |
< | < | ||
Line 100: | Line 98: | ||
public static final class_1741 CUSTOM_ARMOR_MATERIAL = new CustomArmorMaterial(); | public static final class_1741 CUSTOM_ARMOR_MATERIAL = new CustomArmorMaterial(); | ||
- | public static final class_1792 CUSTOM_MATERIAL = new CustomMaterialItem(new class_1792.class_1793().method_7892(ExampleMod.EXAMPLE_MOD_GROUP)); | + | public static final class_1792 CUSTOM_MATERIAL = new CustomMaterialItem(new class_1792.class_1793()); |
// If you made a new material, this is where you would note it. | // If you made a new material, this is where you would note it. | ||
- | public static final class_1792 CUSTOM_MATERIAL_HELMET = new class_1738(CUSTOM_ARMOR_MATERIAL, | + | public static final class_1792 CUSTOM_MATERIAL_HELMET = new class_1738(CUSTOM_ARMOR_MATERIAL, |
- | public static final class_1792 CUSTOM_MATERIAL_CHESTPLATE = new class_1738(CUSTOM_ARMOR_MATERIAL, | + | public static final class_1792 CUSTOM_MATERIAL_CHESTPLATE = new class_1738(CUSTOM_ARMOR_MATERIAL, |
- | public static final class_1792 CUSTOM_MATERIAL_LEGGINGS = new class_1738(CUSTOM_ARMOR_MATERIAL, | + | public static final class_1792 CUSTOM_MATERIAL_LEGGINGS = new class_1738(CUSTOM_ARMOR_MATERIAL, |
- | public static final class_1792 CUSTOM_MATERIAL_BOOTS = new class_1738(CUSTOM_ARMOR_MATERIAL, | + | public static final class_1792 CUSTOM_MATERIAL_BOOTS = new class_1738(CUSTOM_ARMOR_MATERIAL, |
} | } | ||
Line 116: | Line 114: | ||
< | < | ||
public static void register() { | public static void register() { | ||
- | class_2378.method_10230(class_2378.field_11142, new class_2960(" | + | class_2378.method_10230(class_7923.field_41178, new class_2960(" |
- | class_2378.method_10230(class_2378.field_11142, new class_2960(" | + | class_2378.method_10230(class_7923.field_41178, new class_2960(" |
- | class_2378.method_10230(class_2378.field_11142, new class_2960(" | + | class_2378.method_10230(class_7923.field_41178, new class_2960(" |
- | class_2378.method_10230(class_2378.field_11142, new class_2960(" | + | class_2378.method_10230(class_7923.field_41178, new class_2960(" |
- | class_2378.method_10230(class_2378.field_11142, new class_2960(" | + | class_2378.method_10230(class_7923.field_41178, new class_2960(" |
} | } | ||
</ | </ | ||
Line 128: | Line 126: | ||
< | < | ||
public static final class_1761 EXAMPLE_MOD_GROUP = FabricItemGroupBuilder.create( | public static final class_1761 EXAMPLE_MOD_GROUP = FabricItemGroupBuilder.create( | ||
- | new class_2960(" | + | new class_2960(" |
.icon(() -> new class_1799(RegisterItems.CUSTOM_MATERIAL)) // This uses the model of the new material you created as an icon, but you can reference to whatever you like | .icon(() -> new class_1799(RegisterItems.CUSTOM_MATERIAL)) // This uses the model of the new material you created as an icon, but you can reference to whatever you like | ||
.build(); | .build(); | ||
Line 154: | Line 152: | ||
The following should be the same with all armor items, only changing which part are we using. We'll use helmet for our example. | The following should be the same with all armor items, only changing which part are we using. We'll use helmet for our example. | ||
- | <code JSON resources/ | + | <code JSON resources/ |
{ | { | ||
" | " | ||
" | " | ||
- | " | + | " |
} | } | ||
} | } | ||
Line 166: | Line 164: | ||
Generally, mod textures go under resources/ | Generally, mod textures go under resources/ | ||
- | To give your on-body armor a texture, place X_layer_1.png and X_layer_2.png (where X is the <yarn method_7694> | + | To give your on-body armor a texture, place X_layer_1.png and X_layer_2.png (where X is the <yarn method_7694> |
If you followed everything, you should now be able to have a full armor set! | If you followed everything, you should now be able to have a full armor set! |
tutorial/armor.1656055022.txt.gz · Last modified: 2022/06/24 07:17 by daomephsta