Skip to content

Commit

Permalink
Restore spawning random brooms in loot chests
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Jul 24, 2024
1 parent e9030d4 commit c6cd04a
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/main/java/org/cyclops/evilcraft/item/ItemBroomConfig.java
Original file line number Diff line number Diff line change
@@ -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}.
Expand Down Expand Up @@ -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);
}
}

}
Original file line number Diff line number Diff line change
@@ -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
}
]
}
]
}

0 comments on commit c6cd04a

Please sign in to comment.