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

Hi,

 

Is there a way to access a `LootTableManager` when a `LootTableLoadEvent` is fired? I wanted to replace a `LootTable`, but wanted to use `lootTableManager.getLootTableFromLocation(...)` instead of having to manually build the whole `lootTable` object.

 

thanks!

 

[]s,

just you wait! ;)

It doesn't look you have access to the LootTableManager from LootTableLoadEvent. Since the event gives you the option of replacing the LootTable with another one, it probably should give you access to the LootTableManager.

 

You could suggest this be changed, but in the mean time you can remove the LootTable's existing LootPools and then add a new one with a LootEntryTable in it that references the replacement LootTable.

Edited by Choonster
Typo

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

  • Author

Thanks, I'll investigate a bit more around the first option. The second one would still mean that I have to manually create the loot table, right? Which is what I'm trying to avoid, since I want to use a loot table defined in a json file.

just you wait! ;)

Just now, jcranky said:

Thanks, I'll investigate a bit more around the first option. The second one would still mean that I have to manually create the loot table, right? Which is what I'm trying to avoid, since I want to use a loot table defined in a json file.

 

No, LootEntryTable takes the ResourceLocation of a LootTable and loads it from the LootTableManager when loot is generated from the containing LootTable.

 

I use LootEntryTable to add one LootTable to another here.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

  • Author

Ah, I missed that fact. So basically this is an entry that is itself a whole table, and in this case the trick is to make sure it is the only entry in the loot table being replaced? Feels a bit like a hack, but solves the problem - I'll start in that direction for now :)

 

Thanks for the code sample, it helped a lot!

just you wait! ;)

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.