Posted February 19, 20178 yr 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!
February 19, 20178 yr 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 February 19, 20178 yr 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.
February 19, 20178 yr 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!
February 19, 20178 yr 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.
February 19, 20178 yr 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.