tutorial:shield
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
tutorial:shield [2024/09/29 19:20] – cringestar_boi | tutorial:shield [2024/09/29 19:35] (current) – updated with 1.21 guide and past guides cringestar_boi | ||
---|---|---|---|
Line 115: | Line 115: | ||
</ | </ | ||
- | Lastly, as a [[tags|conventional tag]], create a '' | + | Then, as a [[tags|conventional tag]], create a '' |
<code javascript resources/ | <code javascript resources/ | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ] | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Lastly, to make it enchantable, | ||
+ | <code javascript resources/ | ||
{ | { | ||
" | " | ||
Line 140: | Line 150: | ||
public static final Item NETHERITE_BANNER_SHIELD = register(new FabricBannerShieldItem(new FabricItemSettings().maxDamage(2500), | public static final Item NETHERITE_BANNER_SHIELD = register(new FabricBannerShieldItem(new FabricItemSettings().maxDamage(2500), | ||
</ | </ | ||
+ | If you want to add your shield to a [[itemgroup|item groups]], for example, the " | ||
+ | |||
+ | < | ||
+ | public class ExampleMod implements ModInitializer { | ||
+ | @Override | ||
+ | public void onInitialize() { | ||
+ | ItemGroupEvents.modifyEntriesEvent(ItemGroups.COMBAT).register(entries -> { | ||
+ | // ... | ||
+ | entries.add(NETHERITE_BANNER_SHIELD); | ||
+ | }); | ||
+ | } | ||
+ | } | ||
+ | </ | ||
Now the item is created, we need to set up its rendering. For these steps, we are going to be working in our client mod initializer, | Now the item is created, we need to set up its rendering. For these steps, we are going to be working in our client mod initializer, | ||
Line 147: | Line 170: | ||
@Environment(EnvType.CLIENT) | @Environment(EnvType.CLIENT) | ||
public class ExampleModClient implements ClientModInitializer { | public class ExampleModClient implements ClientModInitializer { | ||
- | public static final EntityModelLayer NETHERITE_BANNER_SHIELD_MODEL_LAYER = new EntityModelLayer(new Identifier(" | + | public static final EntityModelLayer NETHERITE_BANNER_SHIELD_MODEL_LAYER = new EntityModelLayer(Identifier.of(" |
@Override | @Override | ||
Line 162: | Line 185: | ||
public class ExampleModClient implements ClientModInitializer { | public class ExampleModClient implements ClientModInitializer { | ||
- | public static final EntityModelLayer NETHERITE_SHIELD_MODEL_LAYER = new EntityModelLayer(new Identifier(" | + | public static final EntityModelLayer NETHERITE_SHIELD_MODEL_LAYER = new EntityModelLayer(Identifier.of(" |
@Override | @Override | ||
Line 176: | Line 199: | ||
@Environment(EnvType.CLIENT) | @Environment(EnvType.CLIENT) | ||
public class ExampleModClient implements ClientModInitializer { | public class ExampleModClient implements ClientModInitializer { | ||
- | public static final EntityModelLayer NETHERITE_SHIELD_MODEL_LAYER = new EntityModelLayer(new Identifier(" | + | public static final EntityModelLayer NETHERITE_SHIELD_MODEL_LAYER = new EntityModelLayer(Identifier.of(" |
| | ||
public static ShieldEntityModel modelNetheriteShield; | public static ShieldEntityModel modelNetheriteShield; | ||
Line 192: | Line 215: | ||
@Environment(EnvType.CLIENT) | @Environment(EnvType.CLIENT) | ||
public class ExampleModClient implements ClientModInitializer { | public class ExampleModClient implements ClientModInitializer { | ||
- | public static final EntityModelLayer NETHERITE_SHIELD_MODEL_LAYER = new EntityModelLayer(new Identifier(" | + | public static final EntityModelLayer NETHERITE_SHIELD_MODEL_LAYER = new EntityModelLayer(Identifier.of(" |
| | ||
public static ShieldEntityModel modelNetheriteShield; | public static ShieldEntityModel modelNetheriteShield; | ||
Line 213: | Line 236: | ||
public class ExampleModClient implements ClientModInitializer { | public class ExampleModClient implements ClientModInitializer { | ||
- | public static final EntityModelLayer netherite_banner_shield_model_layer = new EntityModelLayer(new Identifier(" | + | public static final EntityModelLayer netherite_banner_shield_model_layer = new EntityModelLayer(Identifier.of(" |
public static ShieldEntityModel modelNetheriteShield; | public static ShieldEntityModel modelNetheriteShield; | ||
- | public static final SpriteIdentifier NETHERITE_BANNER_SHIELD_BASE = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE, | + | public static final SpriteIdentifier NETHERITE_BANNER_SHIELD_BASE = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE, |
- | public static final SpriteIdentifier NETHERITE_BANNER_SHIELD_BASE_NO_PATTERN = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE, | + | public static final SpriteIdentifier NETHERITE_BANNER_SHIELD_BASE_NO_PATTERN = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE, |
@Override | @Override | ||
Line 236: | Line 259: | ||
@Environment(EnvType.CLIENT) | @Environment(EnvType.CLIENT) | ||
public class ExampleModClient implements ClientModInitializer { | public class ExampleModClient implements ClientModInitializer { | ||
- | public static final EntityModelLayer netherite_banner_shield_model_layer = new EntityModelLayer(new Identifier(" | + | public static final EntityModelLayer netherite_banner_shield_model_layer = new EntityModelLayer(Identifier.of(" |
public static ShieldEntityModel modelNetheriteShield; | public static ShieldEntityModel modelNetheriteShield; | ||
- | public static final SpriteIdentifier NETHERITE_BANNER_SHIELD_BASE = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE, | + | public static final SpriteIdentifier NETHERITE_BANNER_SHIELD_BASE = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE, |
- | public static final SpriteIdentifier NETHERITE_BANNER_SHIELD_BASE_NO_PATTERN = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE, | + | public static final SpriteIdentifier NETHERITE_BANNER_SHIELD_BASE_NO_PATTERN = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE, |
@Override | @Override | ||
Line 278: | Line 301: | ||
</ | </ | ||
- | Next, inside '' | + | Next, inside '' |
<code javascript resources/ | <code javascript resources/ | ||
{ | { | ||
Line 299: | Line 321: | ||
" | " | ||
" | " | ||
- | " | + | " |
} | } | ||
} | } | ||
Line 308: | Line 330: | ||
Then, you will move both of these textures into '' | Then, you will move both of these textures into '' | ||
- | Lastly, create a '' | + | Next, create a '' |
<code javascript resources/ | <code javascript resources/ | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ] | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Finally create a '' | ||
+ | <code javascript resources/ | ||
{ | { | ||
" | " | ||
Line 346: | Line 378: | ||
===== Changes for 1.20.6 ===== | ===== Changes for 1.20.6 ===== | ||
If you are working in 1.20.6, first change the FabricShieldLib and FAPI versions accordingly and change your other dependencies to these versions:\\ | If you are working in 1.20.6, first change the FabricShieldLib and FAPI versions accordingly and change your other dependencies to these versions:\\ | ||
- | **gradle.properties** | + | |
- | <code java> | + | <file properties |
mod_menu_version=10.0.0-beta.1 | mod_menu_version=10.0.0-beta.1 | ||
midnightlib_version=1.5.5-fabric | midnightlib_version=1.5.5-fabric | ||
- | </code> | + | </file> |
Next, change all instances of '' | Next, change all instances of '' | ||
Line 360: | Line 392: | ||
===== Changes for 1.20.4 ===== | ===== Changes for 1.20.4 ===== | ||
If you are working in 1.20.4, **follow the changes for 1.20.6 first**, then change the FabricShieldLib and FAPI versions accordingly and change your other dependencies to these versions:\\ | If you are working in 1.20.4, **follow the changes for 1.20.6 first**, then change the FabricShieldLib and FAPI versions accordingly and change your other dependencies to these versions:\\ | ||
+ | |||
**gradle.properties** | **gradle.properties** | ||
- | <code java> | + | <file properties gradle.properties> |
midnightlib_version=1.5.2-fabric | midnightlib_version=1.5.2-fabric | ||
mod_menu_version=9.0.0-pre.1 | mod_menu_version=9.0.0-pre.1 | ||
- | </code> | + | </file> |
Additionally, | Additionally, | ||
Line 370: | Line 403: | ||
===== Changes for 1.19 ===== | ===== Changes for 1.19 ===== | ||
If you are working in 1.19, **follow the changes for 1.20.6 and 1.20.4 first**, then change the FabricShieldLib and FAPI versions accordingly and change your other dependencies to these versions:\\ | If you are working in 1.19, **follow the changes for 1.20.6 and 1.20.4 first**, then change the FabricShieldLib and FAPI versions accordingly and change your other dependencies to these versions:\\ | ||
+ | |||
**gradle.properties** | **gradle.properties** | ||
- | <code java> | + | <file properties gradle.properties> |
midnightlib_version=1.0.0-fabric | midnightlib_version=1.0.0-fabric | ||
mod_menu_version=4.2.0-beta.2 | mod_menu_version=4.2.0-beta.2 | ||
- | </code> | + | </file> |
tutorial/shield.1727637622.txt.gz · Last modified: 2024/09/29 19:20 by cringestar_boi