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.

Siqhter

Members
  • Joined

  • Last visited

  1. Have you taken a look at the code in your editor for other gen structures? Specifically in net.minecraft.village. This line caught my eye, not sure if it's really what your looking for. Have a look through that class, there should be some loot-generation code along the lines of what you're looking for.
  2. Yes, and this what is called "cargo cult programming". It works for one person, so then other people start copying it without thinking. (And yes, this happens to pretty much every beginner, myself included. It's how you learn. )
  3. You also have a FileNotFound for ruby.json. Are you sure you're directing it to the right path?
  4. This is the slot code used in my custom container class: If I remove the for loop and just make it a single row of 9 slots (like a hotbar) it works fine, I put the items in the hopper, they transfer to the chest, works great. When I create this for loop for another row above the first one, the items transfer from the hopper into the chest, but don't actually appear in the chest. The funny thing is, when I break the container, they do drop the items into the world just fine. I am pretty sure this is not a capabilities issue, because the for loop is the direct result of the mysterious disappearing of said hopper-transfer-items. Thanks.
  5. Yep it was confused. Thanks.
  6. So then how would I tell the "SlotCrafting" class, (or whichever class responsible) to look for the json?
  7. There's LivingHurtEvent and LivingAttackEvent. This sounds like what you're looking for.
  8. Ok, I was wondering about customization, and hardcoding it didn't seem quite right. Thanks.
  9. In the breakBlock method, loop through the inventory's slots. Create a new EntityItem in the for loop and then call spawnAsEntity. I think InventoryHelper#dropInventoryItems wants an IInventory, which probably won't work in your case. This is somewhat how I did it, and I use ItemStackHandler.
  10. Ok thanks. I have just been told to use an itemstackhandler and not use the vanilla "IInventory". I'll look through the git some more.
  11. Thanks for the response, just to clarify it looks like you're using IInventory? Would it look much different to use IItemStackHandler? I just noticed this in your TileEntity as well as your container. 2nd question is, when you're adding a recipe, are you actually hardcoding that in the recipes java class, or do you then define it in json format?
  12. Basically I'm trying to create a crafting system, where instead of creating a shape and getting a result in the 3x3 table, you open up the custom interface, put the two items in their respective slots and get the output. (e.g., instead of surrounding an apple with gold, put the gold in the first slot, apple in the second, and the result is a golden apple.) I've taken a look at ContainerWorkbench, but what really is the proper way to create a "crafting" slot that looks specifically for two items and provides you with a result? I already have the interface working, gui, tileentity (which I might not need...) etc. Just wondering specifically about the crafting mechanic. Thanks.
  13. instead of item/generated in your item json.
  14. Yep, definitely, thanks to both of you.

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.