Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I would like to add a "Capability" to my armor and that at each "level" it changes the texture of the armor

In practice:

I created a custom armor, I wanted it to have a Capability of "Magic Power" and "Magic Resistance"

And I wanted its texture to change as this capability changed, something like:

if (armor.MagicPower == 1) {
show "armor.textureMagicPower1"
}
if (armor.MagicPower == 2) {
show "armor.textureMagicPower2"
}

if (armor.MagicPower == 2 && armor.MagicResistance == 1) {
show "armor.textureMagicPower2MagicResistance1"
}

How can I do this?

  • Author

I already did a "ModItemProperties" class
 

Quote

public class ModItemProperties {
public static void addCustomItemProperties() {
makeArmor(ModItens.MAGIC_ARMOR.get());
}

private static void makeArmor(Item item) {
ItemProperties.register(item, new ResourceLocation("magicresistancelevel"), (s1, s2, s3, s4) -> {
return s3 != null && s3.isUsingItem() && s3.getUseItem() == s1 ? 1.0F : 0.0F;
});
ItemProperties.register(item, new ResourceLocation("magicpowerlevel"), (s1, s2, s3, s4) -> {
return s3 != null && s3.isUsingItem() && s3.getUseItem() == s1 ? 1.0F : 0.0F;
});
}
}

But I need to know how to change texture and change magicpowerlevel...

Basically, I'm using a super improvised system at the moment, so what I want is that:

When the player's thirst reaches the maximum it returns to "0" and adds 1 in "magicpowerlevel" of the armor, and every 1 level, the texture of the armor changes...

P.s. I Already did the system to whente player's thirst reachs the maximum it return to "0", I only need to know how to add 1 to "magicpowerlevel"

I believe that the main json file should look something like:

 

Quote

.........
},
"textures": {
"layer0": "tutorialmod:item/magicarmor"
},
"overrides": [
{
"predicate": {
"minecraft:magicpowerlevel": 1,
"minecraft:magicresistancelevel": 0
},
"model": "tutorialmod:item/magicarmor_magicpowerlevel_1"
},
{
"predicate": {
"minecraft:magicpowerlevel": 2,
"minecraft:magicresistancelevel": 0
},
"model": "tutorialmod:item/magicarmor_magicpowerlevel_2"
},
{
"predicate": {
"minecraft:magicpowerlevel": 3,
"minecraft:magicresistancelevel": 1
},
"model": "tutorialmod:item/magicarmor_magicpowerlevel_3_magicresistancelevel_1"
}
]
}

 

Edited by honn3x
adding more content

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.