Fabric API

Fabric API

108M Downloads

ItemPredicate.Builder tag()

IranMine123 opened this issue ยท 1 comments

commented

Hello, I tried to Generate Loot Table data for an item but it seems .tag() is not working.
tried using all tags but it doesn't add "tag" line in JSON file.
Please notice me if I write code wrong or if it's not working please fix it. tysm
addDrop(ModBlocks.SAPPIRE_ORE, oreDrops(ModBlocks.SAPPIRE_ORE, ModItems.SAPPIRE) .pool(new LootPool.Builder() .rolls(ConstantLootNumberProvider.create(1)) .with(AlternativeEntry.builder(ItemEntry.builder(ModBlocks.SAPPIRE_ORE) .conditionally(MatchToolLootCondition.builder( ItemPredicate.Builder.create().enchantment( new EnchantmentPredicate(Enchantments.SILK_TOUCH, NumberRange.IntRange.atLeast(0)) ) // Here's the Problem .tag(ItemTags.PICKAXES)) ), ItemEntry.builder(ModItems.SAPPIRE) .apply(ApplyBonusLootFunction.oreDrops(Enchantments.FORTUNE)) ) ) ));

JSON:
... { "condition": "minecraft:match_tool", "predicate": { "enchantments": [ { "enchantment": "minecraft:silk_touch", "levels": { "min": 1 } } ] } } ...

commented

๐Ÿ‘‹ We use the issue tracker exclusively for final bug reports and feature requests. However, this issue appears to be better suited for either a discussion thread, or a message on our discord server. Please post your request on one of these, and the conversation can continue there.