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.

JKK

Members
  • Joined

  • Last visited

  1. Thank you for the respons Lex. Tbh I was trying out the solution that you first stated (++) but at that time I didn't know I need 2 stacks so I thought it somehow isn't working. For the second one... makes sence to use it that way.
  2. Not to be a smart ass but how are you going to get an Item out of Null? Tbh it is not needed as I checked if the Inventory slot was occupied but rather one too many then one too short
  3. Success!!! After mining (get it through the source code for half a day (not to be provd of I at last came up with a method which does what you want (and so do I). !WARNING! This is a code which was a result of a half a day of reading through the internet so it's not writen well. Also... if you can rewrite in a better state then do that and post it here please. So here goes: I think I also have some explaining to do 1. This goes in the mod_xxx.java 2. For loop loops through the slots in the current inventory (crafting table/inventory crafting space) looking for the item stated in the if statement 3. Now this is the stupid part but I couldn't find a better way... The truth is that takenFromCrafting is called before the ingredients are destroied or at least that is what I've found (Lex?) that is why you have to make an ItemStack of two Items so that one is destroied and the other stays in the grid 4. this in the if statement is the BaseMod class or the class having your item defined in 5. Then is just the damage calculation depending on the ingredient (Item) This is it If you have some more questions be sure to ask and I'll respond asap. Have fun, JKK. EDIT: Eloraam if you see this, would you mind not die because of laughing Maybe even supply us with your code? (not begging ofc)
  4. My bad that is correct. I wasn't paying enough attention.
  5. Note that setting hardness level to -1 renders the block indestructible. OR Use function provided by Forge Block.setBlockUnbreakable() (which does exactly the same as the first option but looks and reads nicer.

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.