Repurposed Structures (Neoforge/Forge)

Repurposed Structures (Neoforge/Forge)

57M Downloads

Loot tables drawing off others

FrogBirdd opened this issue ยท 1 comments

commented

Loot tables like the swamp or crimson house chests draw from both their own and other loottables. I am using custom datapacks to modify the tables, so I will provide them.
2021-05-01_16 29 24

Swamp House:
{ "type": "minecraft:chest", "pools": [ { "rolls": { "min": 2.0, "max": 3.0, "type": "minecraft:uniform" }, "entries": [ { "type": "minecraft:item", "weight": 15, "functions": [ { "function": "minecraft:set_count", "count": { "min": 2.0, "max": 4.0, "type": "minecraft:uniform" } } ], "name": "farmersdelight:rice" }, { "type": "minecraft:item", "weight": 15, "functions": [ { "function": "minecraft:set_count", "count": { "min": 1.0, "max": 4.0, "type": "minecraft:uniform" } } ], "name": "environmental:cattail_seeds" }, { "type": "minecraft:item", "weight": 15, "functions": [ { "function": "minecraft:set_count", "count": { "min": 1.0, "max": 4.0, "type": "minecraft:uniform" } } ], "name": "terraincognita:reeds" }, { "type": "minecraft:item", "weight": 10, "functions": [ { "function": "minecraft:set_count", "count": { "min": 1.0, "max": 3.0, "type": "minecraft:uniform" } } ], "name": "minecraft:bread" }, { "type": "minecraft:item", "weight": 10, "functions": [ { "function": "minecraft:set_count", "count": { "min": 1.0, "max": 3.0, "type": "minecraft:uniform" } } ], "name": "minecraft:emerald" } ] }, { "rolls": { "min": 1.0, "max": 2.0, "type": "minecraft:uniform" }, "entries": [ { "type": "minecraft:item", "weight": 10, "functions": [ { "function": "minecraft:set_count", "count": { "min": 2.0, "max": 4.0, "type": "minecraft:uniform" } } ], "name": "environmental:willow_log" }, { "type": "minecraft:item", "weight": 10, "functions": [ { "function": "minecraft:set_count", "count": { "min": 1.0, "max": 3.0, "type": "minecraft:uniform" } } ], "name": "environmental:willow_sapling" }, { "type": "minecraft:item", "weight": 15, "functions": [ { "function": "minecraft:set_count", "count": { "min": 2.0, "max": 4.0, "type": "minecraft:uniform" } } ], "name": "environmental:mud_ball" }, { "type": "minecraft:item", "weight": 5, "functions": [ { "function": "minecraft:set_count", "count": { "min": 1.0, "max": 2.0, "type": "minecraft:uniform" } } ], "name": "environmental:duck_egg" } ] } ] }

Plains House:
{ "type": "minecraft:chest", "pools": [ { "rolls": { "min": 2.0, "max": 3.0, "type": "minecraft:uniform" }, "entries": [ { "type": "minecraft:item", "weight": 15, "functions": [ { "function": "minecraft:set_count", "count": { "min": 1.0, "max": 3.0, "type": "minecraft:uniform" } } ], "name": "minecraft:apple" }, { "type": "minecraft:item", "weight": 15, "functions": [ { "function": "minecraft:set_count", "count": { "min": 1.0, "max": 4.0, "type": "minecraft:uniform" } } ], "name": "minecraft:carrot" }, { "type": "minecraft:item", "weight": 15, "functions": [ { "function": "minecraft:set_count", "count": { "min": 1.0, "max": 4.0, "type": "minecraft:uniform" } } ], "name": "neapolitan:strawberries" }, { "type": "minecraft:item", "weight": 10, "functions": [ { "function": "minecraft:set_count", "count": { "min": 1.0, "max": 3.0, "type": "minecraft:uniform" } } ], "name": "minecraft:bread" }, { "type": "minecraft:item", "weight": 10, "functions": [ { "function": "minecraft:set_count", "count": { "min": 1.0, "max": 3.0, "type": "minecraft:uniform" } } ], "name": "minecraft:emerald" } ] }, { "rolls": { "min": 1.0, "max": 2.0, "type": "minecraft:uniform" }, "entries": [ { "type": "minecraft:item", "weight": 10, "functions": [ { "function": "minecraft:set_count", "count": { "min": 2.0, "max": 4.0, "type": "minecraft:uniform" } } ], "name": "minecraft:oak_log" }, { "type": "minecraft:item", "weight": 10, "functions": [ { "function": "minecraft:set_count", "count": { "min": 1.0, "max": 3.0, "type": "minecraft:uniform" } } ], "name": "minecraft:oak_sapling" }, { "type": "minecraft:item", "weight": 15, "functions": [ { "function": "minecraft:set_count", "count": { "min": 3.0, "max": 8.0, "type": "minecraft:uniform" } } ], "name": "farmersdelight:straw" }, { "type": "minecraft:item", "weight": 5, "functions": [ { "function": "minecraft:set_count", "count": { "min": 1.0, "max": 2.0, "type": "minecraft:uniform" } } ], "name": "minecraft:egg" } ] } ] }

In the pic I generated a chest using the swamp house table and had loot from the plains table mixed in.

commented

You are talking about the modded loot right? That's intentional actually. Mods adding their loot to structure chests really has no way of finding modded structures chests.

So what I did was use Forge's Global Loot Modification system on my own loottables. What it does is when my chest's loot gets spawned, it will go to the loot table of the equivalent vanilla structure that my structure is based on, roll that loot table, pull out all the modded items, and inject it into the result of my loot table. This maximizes mod compatibility with other mod's modded loot that they add to loot tables.

You can turn off this GLM system for any of my loot tables by overriding this file and list all my loot tables in "blacklisted_loot_tables" list to not automatically import modded loot from the vanilla structure loot tables.
https://github.com/TelepathicGrunt/RepurposedStructures/blob/master/src/main/resources/data/repurposed_structures/loot_modifiers/import_modded_loot.json

Sorry I misunderstood you earlier. But yeah, that was intentional in order to have modded loot be in my loot tables by default with no effort on the player's part

Just ask here if you are having issues getting it to work