diff --git a/src/main/java/org/cyclops/evilcraft/item/ItemBroomConfig.java b/src/main/java/org/cyclops/evilcraft/item/ItemBroomConfig.java index f3f5761331..541ccadb39 100644 --- a/src/main/java/org/cyclops/evilcraft/item/ItemBroomConfig.java +++ b/src/main/java/org/cyclops/evilcraft/item/ItemBroomConfig.java @@ -1,9 +1,13 @@ package org.cyclops.evilcraft.item; +import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Item; +import net.minecraft.world.level.storage.loot.BuiltInLootTables; import org.cyclops.cyclopscore.config.ConfigurableProperty; import org.cyclops.cyclopscore.config.extendedconfig.ItemConfig; +import org.cyclops.cyclopscore.helper.LootHelpers; import org.cyclops.evilcraft.EvilCraft; +import org.cyclops.evilcraft.Reference; /** * Config for the {@link ItemBroom}. @@ -45,4 +49,20 @@ public ItemBroomConfig() { ); } + @Override + public void onForgeRegistered() { + super.onForgeRegistered(); + if (lootChests) { + LootHelpers.injectLootTable(new ResourceLocation(Reference.MOD_ID, "inject/chests/broom"), + BuiltInLootTables.SPAWN_BONUS_CHEST, + BuiltInLootTables.VILLAGE_TOOLSMITH, + BuiltInLootTables.VILLAGE_WEAPONSMITH, + BuiltInLootTables.VILLAGE_SHEPHERD, + BuiltInLootTables.SIMPLE_DUNGEON, + BuiltInLootTables.ABANDONED_MINESHAFT, + BuiltInLootTables.JUNGLE_TEMPLE, + BuiltInLootTables.IGLOO_CHEST); + } + } + } diff --git a/src/main/resources/data/evilcraft/loot_tables/inject/chests/broom.json b/src/main/resources/data/evilcraft/loot_tables/inject/chests/broom.json new file mode 100644 index 0000000000..f82629adb2 --- /dev/null +++ b/src/main/resources/data/evilcraft/loot_tables/inject/chests/broom.json @@ -0,0 +1,76 @@ +{ + "pools": [ + { + "name": "main", + "rolls": 1, + "entries": [ + { + "type": "item", + "entryName": "9500", + "name": "evilcraft:broom", + "weight": 1, + "functions": [ + { + "function": "set_nbt", + "tag": "{\"broom_parts_tag\":[\"evilcraft:rod_wood\", \"evilcraft:brush_wheat\", \"evilcraft:cap_gem_dark\"],\"broom_modifiers_tag\":[{\"id\":\"evilcraft:speed\",\"value\":200.0}],\"Fluid\":{\"Amount\":9000,\"FluidName\":\"evilcraft:blood\"}}" + } + ] + }, + { + "type": "item", + "entryName": "7500", + "name": "evilcraft:broom", + "weight": 1, + "functions": [ + { + "function": "set_nbt", + "tag": "{\"broom_parts_tag\":[\"evilcraft:rod_stone\", \"evilcraft:brush_wool\", \"evilcraft:cap_gem_diamond\"],\"broom_modifiers_tag\":[{\"id\":\"evilcraft:speed\",\"value\":300.0},{\"id\":\"evilcraft:particles\",\"value\":50.0}],\"Fluid\":{\"Amount\":7500,\"FluidName\":\"evilcraft:blood\"}}" + } + ] + }, + { + "type": "item", + "entryName": "6500", + "name": "evilcraft:broom", + "weight": 1, + "functions": [ + { + "function": "set_nbt", + "tag": "{\"broom_parts_tag\":[\"evilcraft:rod_bamboo\", \"evilcraft:brush_twig\", \"evilcraft:cap_metal_gold\"],\"broom_modifiers_tag\":[{\"id\":\"evilcraft:speed\",\"value\":100.0},{\"id\":\"evilcraft:levitation\",\"value\":200.0},{\"id\":\"evilcraft:bouncy\",\"value\":20.0}],\"Fluid\":{\"Amount\":6500,\"FluidName\":\"evilcraft:blood\"}}" + } + ] + }, + { + "type": "item", + "entryName": "6000", + "name": "evilcraft:broom", + "weight": 1, + "functions": [ + { + "function": "set_nbt", + "tag": "{\"broom_parts_tag\":[\"evilcraft:rod_blaze\", \"evilcraft:brush_feather\", \"evilcraft:cap_gem_dark_power\"],\"broom_modifiers_tag\":[{\"id\":\"evilcraft:speed\",\"value\":200.0}],\"Fluid\":{\"Amount\":6000,\"FluidName\":\"evilcraft:blood\"}}" + } + ] + }, + { + "type": "item", + "entryName": "5500", + "name": "evilcraft:broom", + "weight": 1, + "functions": [ + { + "function": "set_nbt", + "tag": "{\"broom_parts_tag\":[\"evilcraft:rod_purpur\", \"evilcraft:brush_honey\", \"evilcraft:cap_metal_iron\"],\"broom_modifiers_tag\":[{\"id\":\"evilcraft:speed\",\"value\":200.0},{\"id\":\"evilcraft:levitation\",\"value\":200.0}],\"Fluid\":{\"Amount\":5500,\"FluidName\":\"evilcraft:blood\"}}" + } + ] + } + ], + "conditions": [ + { + "condition": "random_chance", + "chance": 1 + } + ] + } + ] +} \ No newline at end of file