My goal is to have a mob to have a single guaranteed drop of varying quantity (100% chance to drop between 2–6 of item A) and a low chance to drop a different item in addition (10% chance to drop 1 of item B).
I've tried a boatload of permutations, none of which have worked, and this is where I'm at:
console.info('Hello, World! (You will see this line every time server resources reload)')
ServerEvents.recipes(event => {
// Change recipes here
})
ServerEvents.tags('item', event => {
// Get the #forge:cobblestone tag collection and add Diamond Ore to it
// event.get('forge:cobblestone').add('minecraft:diamond_ore')
// Get the #forge:cobblestone tag collection and remove Mossy Cobblestone from it
// event.get('forge:cobblestone').remove('minecraft:mossy_cobblestone')
})
LootJS.modifiers((event) => {
event
.addEntityLootModifier("minecraft:piglin_brute")
.addWeightedLoot([2,6], [
Item.of("dotcoinmod:copper_coin")]);
})
LootJS.modifiers((event) => {
event
.addEntityLootModifier("minecraft:piglin_brute")
.randomChance(0.1) // 10%
.addLoot(
Item.of("dotcoinmod:silver_coin"));
});```
(For troubleshooting purposes I've been testing with randomChance set to 1.0 just to make sure I'm not getting hit with a bad streak that presents as failure).