Jump to content

stop_x13

Members
  • Posts

    1
  • Joined

  • Last visited

stop_x13's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I'm new to modding and need a little help. I'm wondering how can I override vanilla loot table/pools and NOT overriding any other pools added by other mods? I tried to add custom pool to vanilla loot table and remove vanilla pools during loot table load event. This worked fine alone, but once the mod is built and ran with other mods, appeared that it did not work if I remove the last pool from the vanilla loot table. This is the code section of the loot table load event. I have a "simple_dungeon.json" in the "resources/data/lootinjector/loot_tables/chests" folder. Note: vanilla simple_dungeon has 3 pools, it does not work with other mod if I remove "pool2". @SubscribeEvent public void onLootTableLoad(LootTableLoadEvent event) { //remove vanilla and and replacement pools if(event.getName().toString().startsWith("minecraft:chests/simple_dungeon")) { LOGGER.info("Adding Loot to Simple Dungeon..."); LootTable tbl = event.getTable(); tbl.addPool(buildPool("chests/simple_dungeon")); tbl.removePool("main"); tbl.removePool("pool1"); // Adding the following line will cause error // tbl.removePool("pool2"); } } private static ResourceLocation res(String loc) { return new ResourceLocation(modid, loc); } //build LootPool from json private static LootPool buildPool(final String pool) { return LootPool.builder().addEntry(TableLootEntry.builder(res(pool))).build(); } How do I fix this?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.