#Getting one mob to drop multiple item stacks through LootJS

4 messages · Page 1 of 1 (latest)

brave nexus
#

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).
upper cragBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

stuck glade
#
LootJS.modifiers((event) => {
    event
        .addEntityLootModifier("minecraft:piglin_brute")
        .addLoot(LootEntry.of("dotcoinmod:copper_coin").limitCount([2, 6]))
        .randomChance(0.1)
        .addLoot("dotcoinmod:silver_coin");
});
brave nexus
#

Thanks a million!