补充loottable

This commit is contained in:
17146 2025-04-08 22:45:58 +08:00
parent 76009bf5eb
commit 5c62b01b6c
3 changed files with 37 additions and 27 deletions

View file

@ -1,4 +1,4 @@
// 1.21.1 2025-04-07T06:30:45.3419999 Loot Tables
// 1.21.1 2025-04-08T22:45:20.96671 Loot Tables
98386b2e65b2afb7cf5b0cabf6a7b0f062c1e640 data/superbwarfare/loot_table/blocks/barbed_wire.json
811e69929a14e6736015849c220100bb58d914c9 data/superbwarfare/loot_table/blocks/cemented_carbide_block.json
1f482bc1f0a1026d0e1b75ee28c6f541b56747a5 data/superbwarfare/loot_table/blocks/charging_station.json
@ -25,6 +25,6 @@ fb31a40f6a04000f317823cbb80eda8588ba9c69 data/superbwarfare/loot_table/blocks/si
eef164cceb825ad572fc9d2eaef4631f9ec13c7f data/superbwarfare/loot_table/chests/blue_print_epic.json
f28f40e6bca3090625550f4c62d5f2a1384fe3ba data/superbwarfare/loot_table/chests/blue_print_rare.json
7e75ff103ccdbcf6be6f61413a4173115195f0a9 data/superbwarfare/loot_table/containers/blueprints.json
8722142dcf789090bf49830de44db3cc01b86ce4 data/superbwarfare/loot_table/containers/common.json
be87d07ea13253e7a2237f048acc655e16e8317c data/superbwarfare/loot_table/containers/common.json
151368546abc7b65138a0a822dd53b48999d86be data/superbwarfare/loot_table/special/common/blueprints.json
bdc01aa31e669b8ac6efed218533d51036c912f6 data/superbwarfare/loot_table/special/common/flags.json

View file

@ -131,6 +131,16 @@
],
"name": "minecraft:coal_block",
"weight": 30
},
{
"type": "minecraft:loot_table",
"value": "superbwarfare:special/common/flags",
"weight": 40
},
{
"type": "minecraft:loot_table",
"value": "superbwarfare:special/common/blueprints",
"weight": 50
}
],
"rolls": 1.0

View file

@ -11,6 +11,7 @@ import net.minecraft.world.level.ItemLike;
import net.minecraft.world.level.storage.loot.LootPool;
import net.minecraft.world.level.storage.loot.LootTable;
import net.minecraft.world.level.storage.loot.entries.LootItem;
import net.minecraft.world.level.storage.loot.entries.NestedLootTable;
import net.minecraft.world.level.storage.loot.functions.LootItemFunction;
import net.minecraft.world.level.storage.loot.functions.SetItemCountFunction;
import net.minecraft.world.level.storage.loot.predicates.LootItemCondition;
@ -254,31 +255,30 @@ public class ModCustomLootProvider implements LootTableSubProvider {
)));
output.accept(containers("common"),
LootTable.lootTable().withPool(multiItems(1, 0,
new ItemEntry(ModItems.EPIC_MATERIAL_PACK.get(), 2),
new ItemEntry(ModItems.CEMENTED_CARBIDE_BLOCK.get(), 2),
new ItemEntry(Items.EXPERIENCE_BOTTLE, 2)
.setCount(4),
new ItemEntry(ModItems.RARE_MATERIAL_PACK.get(), 4)
.setCount(2),
new ItemEntry(ModItems.COMMON_MATERIAL_PACK.get(), 6)
.setCount(3),
new ItemEntry(ModItems.STEEL_BLOCK.get(), 14),
new ItemEntry(Items.GOLD_BLOCK, 20),
new ItemEntry(ModItems.HANDGUN_AMMO.get(), 6)
.setCount(64),
new ItemEntry(ModItems.RIFLE_AMMO.get(), 6)
.setCount(64),
new ItemEntry(ModItems.SHOTGUN_AMMO.get(), 6)
.setCount(32),
new ItemEntry(ModItems.SNIPER_AMMO.get(), 6)
.setCount(32),
new ItemEntry(ModItems.HEAVY_AMMO.get(), 6)
.setCount(16),
new ItemEntry(Items.COAL_BLOCK, 30)
.setCount(9))
// TODO LootTableReference
// .add(LootTableReference.lootTableReference(special("common/flags")).setWeight(40))
// .add(LootTableReference.lootTableReference(special("common/blueprints")).setWeight(50))
new ItemEntry(ModItems.EPIC_MATERIAL_PACK.get(), 2),
new ItemEntry(ModItems.CEMENTED_CARBIDE_BLOCK.get(), 2),
new ItemEntry(Items.EXPERIENCE_BOTTLE, 2)
.setCount(4),
new ItemEntry(ModItems.RARE_MATERIAL_PACK.get(), 4)
.setCount(2),
new ItemEntry(ModItems.COMMON_MATERIAL_PACK.get(), 6)
.setCount(3),
new ItemEntry(ModItems.STEEL_BLOCK.get(), 14),
new ItemEntry(Items.GOLD_BLOCK, 20),
new ItemEntry(ModItems.HANDGUN_AMMO.get(), 6)
.setCount(64),
new ItemEntry(ModItems.RIFLE_AMMO.get(), 6)
.setCount(64),
new ItemEntry(ModItems.SHOTGUN_AMMO.get(), 6)
.setCount(32),
new ItemEntry(ModItems.SNIPER_AMMO.get(), 6)
.setCount(32),
new ItemEntry(ModItems.HEAVY_AMMO.get(), 6)
.setCount(16),
new ItemEntry(Items.COAL_BLOCK, 30)
.setCount(9))
.add(NestedLootTable.lootTableReference(special("common/flags")).setWeight(40))
.add(NestedLootTable.lootTableReference(special("common/blueprints")).setWeight(50))
));
output.accept(special("common/flags"), LootTable.lootTable()