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.

[1.7.10][Solved] Is there a way to edit the stats of Vanilla Armor/Horse Armor.

Featured Replies

Posted

I want to reduce the stats of vanilla armor (so new Armor tiers are greater than Diamond). I ended up making new versions of Vanilla armor, and replaced a lot of Vanilla items with my new items, but I need to replace entities that spawn with them, horse armor, and edit chest so they contain the new horse armor instead.

 

I feel like a lot of this effort would be unnecessary if I could just change the stats of the Vanilla Armor and Horse Armor. I read this tutorial (although that now it's @SubscribeEvent instead of @ForgeSubscribe): http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/1571568-tutorial-1-6-2-changing-vanilla-without-editing

 

Is there a way to do this?

What I do for this in my mod is to use a PlayerTickEvent to replace the items if they are in the player's inventory.

Check out my mod, Realms of Chaos, here.

 

If I helped you, be sure to press the "Thank You" button!

  • Author

What I do for this in my mod is to use a PlayerTickEvent to replace the items if they are in the player's inventory.

Wow, that's awesome, thanks. I was doing things the hard way. That's what you did right here right?: https://github.com/Eternaldoom/Realms-of-Chaos/blob/d71501e86807f39dc28e861d3c71b61a27a2b91b/com/eternaldoom/realmsofchaos/event/ItemReplaceEvent.java

@OP - Sorry, I'm about to go slightly off topic for a second.

 

@Eternaldoom - you really ought to reconsider how you are doing that... horribly inefficient. A much better approach would be to Map the item you want to search for to the item you want to replace it with, and do something like this:

@SubscribeEvent
public void onTickEvent(PlayerTickEvent evt){
ItemStack stack;
for (int i = 0; i < evt.player.inventory.getSizeInventory(); ++i) {
stack = evt.player.inventory.getStackInSlot(i);
if (stack != null && yourItemMap.contains(stack.getItem()) && evt.player.inventory.consumeInventoryItem(stack.getItem()) {
evt.player.inventory.setInventorySlotContents(i, new ItemStack(yourItemMap.get(stack.getItem()));
}
}

This is much more efficient and easy to manage than tons of if statements; at the very least, use chained if/else-if statements.

You're right, thanks. I'm probably going to switch over to GameRegistry.addSubstitutionAlias. It'll be more seamless anyway.

Check out my mod, Realms of Chaos, here.

 

If I helped you, be sure to press the "Thank You" button!

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.