Skip to content

[Bug-Report] KesseractJS breaks LootJS #25

@MundM2007

Description

@MundM2007

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions