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.

CrimsonDawn45

Members
  • Joined

  • Last visited

  1. I have added a custom shield to the game which extends the ShieldItem class. Blocking works, switching between the two models using overrides works but I can't seem to get durability for this item to work. Here is the custom shield item class: package me.crimsondawn45.survivaladditions.object.item; import me.crimsondawn45.survivaladditions.util.SAregistries; import net.minecraft.block.DispenserBlock; import net.minecraft.item.ArmorItem; import net.minecraft.item.Item; import net.minecraft.item.ShieldItem; public class SAshieldItem extends ShieldItem { public SAshieldItem(Item.Properties builder) { super(builder); this.addPropertyOverride(SAregistries.resLoc("blocking"), (item, world, entity) -> { return entity != null && entity.isHandActive() && entity.getActiveItemStack() == item ? 1.0F : 0.0F; }); DispenserBlock.registerDispenseBehavior(this, ArmorItem.DISPENSER_BEHAVIOR); } } And here is the instance I am passing into the .registerAll method: SAitems.wooden_shield = new SAshieldItem(new Item.Properties().group(ITEM).maxStackSize(1).maxDamage(100)).setRegistryName(resLoc("wooden_shield")), I have tried using ".defaultMaxDamage()" in the properties bulder and passing in durability directly in the item class using "getMaxUses()"
  2. Well actually I want to know how to intercept events like this in general because I have a few things that are hard coded in vanilla that I need to change for my mod.
  3. I want to create a mod that intercepts the item use event for flint and steel so I don't break crafting recipes by adding a new flint and steel, and I can change what blocks will work as nether portal blocks. So how exactly would I do that?
  4. I should have been more clear basically what I want to do is if you look inside the flint and steel class where it says "== Blocks.OBSIDIAN" I want to change that to if it is in a tag called nether_portal_blocks that I will create I want to add a bunch of blocks that can also be used to create a nether portal
  5. In 1.14.4 the code that decides if a nether portal should open or not is contained within the flint and steel class. I am wondering if there is a way to deregister the flint and steel item then reregister it still under minecraft using my class I have tried making an anonymous subclass but the method I need to change is a protected static. So it wont just let me override that method. I want to do this because I am trying to change how nether portal's work and I need full control of this method.

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.