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.

Featured Replies

Posted

Working on my first mod, and I've followed a few examples to create items and blocks, but I can't for the life of me get my custom loot_table loaded.  If I put a bad element in the json, I see an error in the debug.log, but if the file looks good, it simply doesn't load (nothing shows in the logs.)

 

Stepping through the code, I see it get all the way to ForgeHooks.loadLootTable(), but since custom==true, it never calls the ForgeEventFactory.loadLootTable() method, so it never gets registered (I'm guessing here - while I've got years of Java experience, I only have days of minecraft mod experience.)

 

I've gone over my code many times, and have made it as simple as I can to narrow down potential issues, but I'm stumped.  Running on Forge 1.15.2-1.31.0, Java 1.8.0_161, and Eclipse 2020-03.  I've attached my loot_table and model/block json files, along with the source code where I register everything - anyone have any ideas?

 

Thanks in advance.

 

-mike

ruby_block.json ruby_block.json RegistryHandler.java

I remember that when you do your own loot tables you need to add name tag in front of the "rolls"

{
  "type": "minecraft:block",
  "pools": [
    {
      "name": "a name here",   <-----------
      "rolls": 1,
      "entries": [
        {
          "type": "minecraft:item",
          "name": "minecraft:apple"
        }
      ]
    }
  ]
}

if you want to have a try with that

  • Author

Yeah, I had that in there before.  Just tried again, still doesn't work.

 

{
  "type": "minecraft:block",
  "pools": [
    {
      "name": "tutorial_loot_table",
      "rolls": 1,
      "entries": [
        {
          "type": "minecraft:item",
          "name": "minecraft:apple"
        }
      ]
    }
  ]
}

Everything looks right to me, compared it to a block drop json I have that I know works, seems like everything's right, it looks in the right folder and everything.

 

Just to throw this out there, you aren't in creative mode, are you? Things don't drop in creative mode :)

  • Author

@Ugdhar you're a lifesaver!  I was in creative mode.  I'm writing this mod for my kids, and when I read them your comment, they said, "Yeah, obviously!"  Obviously to them, who play all the time.  I've given them additional chores today to make up for the hours of my life debugging code that was working fine that I'll never get back.

 

Thank you SO much!

 

-mike

 

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.