forked from KubeJS-Mods/KubeJS
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
when switching back to original Kubejs, Loot modifications from LootJS for my ores work again. Code below:
function add_ore_drop(event, block, drops, counts){
event
.addBlockLootModifier(block)
.randomChanceWithEnchantment("minecraft:silk_touch", [1, 0])
.thenRemove(block)
.thenApply((context) => {
if(context.player){
let main_item = context.tool
let level = 0
if(main_item.nbt && main_item.nbt.Enchantments){
for(let i = 0; i < main_item.nbt.Enchantments.length; i++){
if(main_item.nbt.Enchantments[i].id == "minecraft:fortune"){
level = main_item.nbt.Enchantments[i].lvl
break
}
}
}
context.addLoot(Item.of(chooseRandom(drops), calcFortuneDrops(level, counts)))
}else{
context.addLoot(Item.of(chooseRandom(drops), chooseRandom(counts)))
}
})
}this is a silent error with no issue in the log
Metadata
Metadata
Assignees
Labels
No labels