#Change mob drop chance / drop rate of equipped item / weapon

11 messages · Page 1 of 1 (latest)

feral magnet
#

I did a lot of digging, and most of the things I come across are for versions older than 1.20.1


EntityEvents.spawned(event => {
  let entity = event.entity
    if (entity.type == "minecraft:piglin_brute" && Math.random() < 1.0) { //spawn chance with item
        entity.mergeNbt(`{HandDropChances:[1.0f, 1.0f]}`) //drop chance
        entity.setItemSlot(0, "simplyswords:soulstealer")}
})``` This is what I've got so far, no errors for my loot.js file in the logs. It just doesn't drop. The entity does spawn with it however.
quiet sapphireBOT
#

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

wide locustBOT
#

Paste version of server.log from @feral magnet

#

LootJS is an addon for KubeJS that allows modifying loot from all sources dynamically (much nicer than loot tables)!
It also supports removing loot added by mods, unlike KubeJS' current loot table events.

feral magnet
feral magnet
viscid berry
#

did you try that? other than that idk
best to ask the developers in their support channels

feral magnet
feral magnet
#

EntityEvents.spawned(event => {
  let entity = event.entity
    if (entity.type == "minecraft:piglin_brute" && Math.random() < 1.0) { //spawn chance with item
        entity.setDropChance(0, 1)
        entity.setItemSlot(0, "simplyswords:soulstealer")
        entity.setItemSlot(4, "minecraft:netherite_chestplate")
        entity.setItemSlot(2, "minecraft:netherite_boots")
    }
})``` Tried this also didn't pan out