Lootr (Forge & NeoForge)

Lootr (Forge & NeoForge)

66M Downloads

Crash when opening Lootr chests

Alcheon86 opened this issue ยท 14 comments

commented

I'm using modpack All of Fabric 1.18.2 on my home server and when trying to open a chest the server hangs and crashes with this report. Any help would be appreciated. Thanks.

https://pastebin.com/Rr9cnqUf

commented

What chest are you trying to open? This is a watchdog crash, which means the server stopped responding while trying to generate loot. Most likely it has to do with treasure maps but I can't be certain.

commented

I have the same problem when I try to open a lootr chest. The world keeps crashing on startup until I delete the mod. Fabric 1.19.2 with lootr-1.19-0.4.22.61. This is a new single player world.

commented

I have had the same problem and, tried to recreate the issue in singleplayer.

Used same world, same coordinates, same chest, etc. The game lagged for a little bit before finally opening the chest. Inside were a couple of papers and... a Buried Treasure Map (who would've guessed). After looking through the other issues with Terralith treasure maps and such, the conclusion I derived is that any sort of Buried Treasure Map simply does not function with ANY type of pre-generated terrain, even custom maps.

Is there a possibility to blacklist the Buried Treasure Map from the Lootr loot tables, without blacklisting all the tables containing it? I am not sure which tables do contain it and also uncertain on how to actually write that in the config.

Hopefully this helps!

commented

Please refer to the comments in #100 which is pinned for precisely this reason -- especially for the interactions with Terralith.

commented

Tested on Fabric only
You will want to get Loot Config mod. Then, in the config of the mod, in the JSON file replace_config.json, write the following code:
{ "LootTableIds": { "minecraft:chests/shipwreck_map": { "LootPools": ["remove_treasure_map"] } }, "Names": { } }

then, in the settings_and_definitions.json, write the following:
{ "LoadPoolsAtRuntime": true, "NameDefinitions": { }, "LootPoolDefinitions": { "remove_treasure_map": { "MinRolls": 3, "MaxRolls": 3, "RollSuccessChance": 1.0, "LootingRollSuccessModifier": 0, "MinBonusRolls": 0, "MaxBonusRolls": 0, "Conditions": { }, "Entries": { "minecraft:compass": [1, 1], "minecraft:map": [1, 1], "minecraft:clock": [1, 1], "minecraft:paper": [5, 20], "minecraft:feather": [3, 10], "minecraft:book": [3, 5] } } } }

This essentially creates a loot table without the Buried Treasure Map and, replace the vanilla Sunken Ship loot table with the modded one created by Loot Config. I have tried it on singleplayer and the chest opened immediately, giving an Empty Map instead of the Buried Treasure Map.

I will look also for the Sunken Ruins loot table as that also contains it. But the procedure should be almost the same.

commented

Ah, I misunderstood. Have you confirmed if the lag exists without Lootr installed? It may be the same issue: a standard Minecraft treasure map is attempting to locate a biome that doesn't exist in your custom map.

Unfortunately, Lootr doesn't allow you to modify loot tables. You'd need to work out what the loot table in question is (the data command should help here) and then use a data pack or another mod to modify it.

commented

I do not have Terralith, or any world-generation mods. I am simply playing on a custom-made map. I have already tried to run the command provided in #100 but, it does not function. The command is not even recognized.

commented

No problem. I have gone ahead and tested the issue. Fortunately and unfortunately, the Buried Treasure map spawning in a vanilla chest, without Lootr being present leads to the same result.

Wouldn't the Lootr config bit "loot_table_blacklist": [] allow for a specified loot table to be disabled? Has anyone experimented with this? I tried the following

"loot_table_blacklist": [ "minecraft:chests/shipwreck_treasure" ],

but I am not sure if it actually works as intended. After applying the aforementioned adjustment, I restarted the server and tried opening the chest again, only for the crash to persist. I am aware that the Buried Treasure Map is also part of the Underwater Ruins loot table but, I didn't try removing it also from there... because, well, I don't know if my code worked in the first place haha.

commented

Okay, I'd suggest checking how to manually remove the buried treasure maps from the relevant loot table; all the blacklist will do is prevent those chests being converted into Lootr chests -- it won't stop them from actually generating treasure maps, which seems to be the issue.

commented

Sorry, I'm not that good with code. I've been looking around trying to find a mod that does that but, Loot Config (one of the ones I've used) doesn't even have the functionality to simply remove one singular item, instead needing to remake the entire loot table without the item in question.

For now, just being able to tell the chests apart is good enough. It allows the server to run, while I look for an actual solution. Being able to just filter which chests are "bad" by seeing them different from all the other Lootr chests should suffice for the people on my server.

So could you confirm whether the previously written bit actually works as intended or not? And would it require a world reset or, would it just apply immediately after restarting the world? I didn't see it work on mine so, either I wrote the code wrong, or it's another loot table or, a world reset is required.

As soon as I find a solution that works for me, I'll post it here, if you don't find something on your side in the meantime.

commented

Yes, it would require a world reset as once chests are converted only once.

commented

Thanks, I'll pin this.

commented

If you can test opening the same chest in a new world (same seed) without Lootr installed, that would help significantly. Knowing hte loot table and the item in the chest would also help. Unfortunately, there isn't enough information to even begin trynig to replicate.

commented

I've got the same issue, opening the chest causes a memory leak