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.

penguinsfan77

Forge Modder
  • Joined

  • Last visited

Everything posted by penguinsfan77

  1. I never used an ObjectHolder annotation. That's why I'm so confused.
  2. Looking through the FML code that seems to happen when the object you are registering is neither an Item or a Block. Are your classes extending Item or Block?
  3. When I launch the game from eclipse, the game crashes on start up. Crash log: http://pastebin.com/1hDHLXE8 I have no idea whats happening as nothing in the stacktrace points to my code. So what is triggering the crash?
  4. So the hammer class now extends item tool and i discovered that the reason that the item wasn't breaking was because I wasn't actually breaking a block. So i moved my code out of the ItemEventHandler class and into the onBlockDestroyed method. This allows the item to break properly however the stone is not cracking anymore and it seems that the setBlock() method doesn't work. Here is what I have: @Override public boolean onBlockDestroyed(ItemStack item, World world, Block block, int x, int y, int z, EntityLivingBase player) { item.damageItem(1, player); if (block.equals(Blocks.stone)) { world.setBlock(x, y, z, ModBlocks.crackedStone); } return true; } Could someone try to explain why the block that was broken is not replaced by cracked stone?
  5. I'm going to try making the hammer class extend ItemTool to see if that works. I will post an update once I'm on my computer.
  6. Thanks for your help. That should fix the issue of the item not going away but I don't think it it will fix the issue of of the item not playing the break sound or particle effect.
  7. I have a hammer in my mod which when you left click on stone it makes it cracked stone. The item damages fine but when it reaches 0 durability, the item damage returns to 0 and the stack size is reduced to zero, however the item doesn't go away. Also, the breaking animation and sound is not shown or played. Source code: https://github.com/penguinsfan77/RandomStuff/ The item is damaged and the stone is cracked in the ItemEventHandler class in the events package. The Hammer class is in the items package. Any help is greatly appreciated, thanks.

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.