// priority: 0

settings.logAddedRecipes = true
settings.logRemovedRecipes = true
settings.logSkippedRecipes = false
settings.logErroringRecipes = true

console.info('Hello, World! (You will see this line every time server resources reload)')

onEvent("lootjs", (event) => {
    event.removeGlobalModifier("@farmersdelight");
    event.removeGlobalModifier("@moguns");
});

onEvent('recipes', event => {
	// Change recipes here
	
	event.remove({output: 'darkutils:charm_portal'})

	event.remove({output: 'minecraft:end_crystal'})

	event.remove({id: 'betterendforge:flame_book'})
	event.remove({id: 'betterendforge:smite_book'})
	event.remove({id: 'betterendforge:knockback_book'})
	event.remove({id: 'betterendforge:unbreaking_book'})
	event.remove({id: 'betterendforge:luck_of_sea_book'})
	event.remove({id: 'betterendforge:thorns_book'})
	event.remove({id: 'betterendforge:riptide_book'})
	event.remove({id: 'betterendforge:depth_strider_book'})
	event.remove({id: 'betterendforge:frost_walker_book'})
	event.remove({id: 'betterendforge:blast_protection_book'})
	event.remove({id: 'betterendforge:punch_book'})
	event.remove({id: 'betterendforge:channeling_book'})
	event.remove({id: 'betterendforge:sweeping_book'})
	event.remove({id: 'betterendforge:bane_of_arthropods_book'})
	event.remove({id: 'betterendforge:fortune_book'})
	event.remove({id: 'betterendforge:sharpness_book'})
	event.remove({id: 'betterendforge:power_book'})
	event.remove({id: 'betterendforge:multishot_book'})
	event.remove({id: 'betterendforge:lure_book'})
	event.remove({id: 'betterendforge:aqua_affinity_book'})
	event.remove({id: 'betterendforge:mending_book'})
	event.remove({id: 'betterendforge:fire_aspect_book'})
	event.remove({id: 'betterendforge:projectile_protection_book'})
	event.remove({id: 'betterendforge:soul_speed_book'})
	event.remove({id: 'betterendforge:piercing_book'})
	event.remove({id: 'betterendforge:infinity_book'})
	event.remove({id: 'betterendforge:feather_falling_book'})
	event.remove({id: 'betterendforge:silk_touch_book'})
	event.remove({id: 'betterendforge:protection_book'})
	event.remove({id: 'betterendforge:quick_charge_book'})
	event.remove({id: 'betterendforge:impaling_book'})
	event.remove({id: 'betterendforge:looting_book'})
	event.remove({id: 'betterendforge:loyalty_book'})
	event.remove({id: 'betterendforge:efficiency_book'})
	event.remove({id: 'betterendforge:fire_protection_book'})
	event.remove({id: 'betterendforge:respiration_book'})

	event.remove({output: 'pneumaticcraft:vortex_cannon'})
	event.remove({output: 'pneumaticcraft:armor_upgrade'})
	event.remove({output: 'pneumaticcraft:jumping_upgrade_1'})
	event.remove({output: 'pneumaticcraft:jumping_upgrade_2'})
	event.remove({output: 'pneumaticcraft:jumping_upgrade_3'})
	event.remove({output: 'pneumaticcraft:jumping_upgrade_4'})
	event.remove({output: 'pneumaticcraft:jet_boots_upgrade_1'})
	event.remove({output: 'pneumaticcraft:jet_boots_upgrade_2'})
	event.remove({output: 'pneumaticcraft:jet_boots_upgrade_3'})
	event.remove({output: 'pneumaticcraft:jet_boots_upgrade_4'})
	event.remove({output: 'pneumaticcraft:jet_boots_upgrade_5'})

	event.remove({id: 'boss_tools:nasa_workbench'})
	event.remove({id: 'boss_tools:rocket_nose_cone'})
	event.remove({id: 'boss_tools:rocket_fins'})
	event.remove({id: 'boss_tools:iron_tank'})
	event.remove({id: 'boss_tools:engine_fan'})
	event.remove({id: 'boss_tools:iron_engine'})
	event.remove({id: 'boss_tools:engine_frame'})
	event.remove({id: 'boss_tools:golden_tank'})
	event.remove({id: 'boss_tools:golden_engine'})
	event.remove({id: 'boss_tools:diamond_tank'})
	event.remove({id: 'boss_tools:diamond_engine'})
	
	event.remove({output: 'dimdungeons:item_portal_key'})
	event.remove({output: 'dimdungeons:item_homeward_pearl'})
	
	event.remove({output: 'mining_dimension:teleporter'})

	event.remove({output: 'mod_lavacow:bonesword'})
	event.remove({output: 'mod_lavacow:felarmor_helmet'})
	event.remove({output: 'mod_lavacow:felarmor_chestplate'})
	event.remove({output: 'mod_lavacow:felarmor_leggings'})
	event.remove({output: 'mod_lavacow:felarmor_boots'})
	event.remove({output: 'mod_lavacow:faminearmor_helmet'})
	event.remove({output: 'mod_lavacow:faminearmor_chestplate'})
	event.remove({output: 'mod_lavacow:faminearmor_leggings'})
	event.remove({output: 'mod_lavacow:faminearmor_boots'})
	event.remove({output: 'mod_lavacow:thorn_shooter'})
	event.remove({output: 'mod_lavacow:ghostlyarmor_helmet'})
	event.remove({output: 'mod_lavacow:ghostlyarmor_chestplate'})
	event.remove({output: 'mod_lavacow:ghostlyarmor_leggings'})
	event.remove({output: 'mod_lavacow:ghostlyarmor_boots'})

	event.remove({id: 'industrialforegoing:machine_frame_pity'})
	event.remove({id: 'industrialforegoing:dissolution_chamber/simple_machine_frame'})
	event.remove({id: 'industrialforegoing:dissolution_chamber/advanced_machine_frame'})
	event.remove({id: 'industrialforegoing:dissolution_chamber/supreme_machine_frame'}) 
	event.remove({id: 'industrialforegoing:mob_duplicator'})
	event.remove({output: 'industrialforegoing:wither_builder'})
	event.remove({output: 'industrialforegoing:infinity_trident'})
	event.remove({output: 'industrialforegoing:infinity_launcher'})
	event.remove({output: 'industrialforegoing:infinity_nuke'})
	event.remove({output: 'industrialforegoing:infinity_hammer'})
	event.remove({id: 'industrialforegoing:dissolution_chamber/laser_lens0'})
	event.remove({id: 'industrialforegoing:dissolution_chamber/laser_lens1'})
	event.remove({id: 'industrialforegoing:dissolution_chamber/laser_lens2'})
	event.remove({id: 'industrialforegoing:dissolution_chamber/laser_lens3'})
	event.remove({id: 'industrialforegoing:dissolution_chamber/laser_lens4'})
	event.remove({id: 'industrialforegoing:dissolution_chamber/laser_lens5'})
	event.remove({id: 'industrialforegoing:dissolution_chamber/laser_lens6'})
	event.remove({id: 'industrialforegoing:dissolution_chamber/laser_lens7'})
	event.remove({id: 'industrialforegoing:dissolution_chamber/laser_lens8'})
	event.remove({id: 'industrialforegoing:dissolution_chamber/laser_lens9'})
	event.remove({id: 'industrialforegoing:dissolution_chamber/laser_lens10'})
	event.remove({id: 'industrialforegoing:dissolution_chamber/laser_lens11'})
	event.remove({id: 'industrialforegoing:dissolution_chamber/laser_lens12'})
	event.remove({id: 'industrialforegoing:dissolution_chamber/laser_lens13'})
	event.remove({id: 'industrialforegoing:dissolution_chamber/laser_lens14'})
	event.remove({id: 'industrialforegoing:dissolution_chamber/laser_lens15'})
	event.remove({id: 'industrialforegoing:dissolution_chamber/infinity_drill'})
	event.remove({id: 'industrialforegoing:dissolution_chamber/infinity_saw'})

	event.remove({id: 'thermal_extra:dragon_integral_component'})

	event.remove({id: 'scannable:scanner'})

	event.remove({output: 'mmorpg:craft_tools/jewel_craft'})
	event.remove({output: 'mmorpg:craft_tools/wep_craft'})
	event.remove({output: 'mmorpg:craft_tools/armor_craft'})
	
	event.remove({output: 'divine_missions:shrine'})
	
	event.remove({id: 'thermal_extra:machine/smelter/polarium_dust'})
	event.remove({id: 'thermal_extra:machine/smelter/vukaium_dust'})
	event.remove({id: 'thermal_extra:machine/smelter/nectium_dust'})
	event.remove({id: 'thermal_extra:machine/smelter/zauvium_dust'})
	event.remove({id: 'thermal_extra:machine/smelter/drownium_dust'})

	event.remove({output: 'pneumaticcraft:jackhammer'})
	event.remove({output: 'pneumaticcraft:drill_bit_iron'})
	event.remove({output: 'pneumaticcraft:drill_bit_compressed_iron'})
	event.remove({output: 'pneumaticcraft:drill_bit_diamond'})
	event.remove({output: 'pneumaticcraft:drill_bit_netherite'})

	event.remove({output: 'mmorpg:potions/reset_all_perks'})
	event.remove({output: 'mmorpg:potions/add_reset_perk_points'})
})

function randomBetween(min, max) {
	return Math.floor(Math.random() * (max - min)) + min;
  }

onEvent('item.tags', 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')
})
//
//
//
//
//
//
//
//
// breaking spawners in overworld dimension will spawn 3 zombies - 25% chance
// i stole this from Swedz on the lootjs discord :)
onEvent("lootjs", (event) => {
	event
		.addBlockLootModifier("minecraft:spawner")
		.anyDimension("minecraft:overworld") 
        .randomChance(0.25)
		.thenApply((context) => {
			var level = context.level
			var pos = context.blockPos
			var block = level.getBlock(pos)
	  
			block.set('minecraft:air')
	  
			var zombieSpawn = level.createEntity('minecraft:zombie')
			zombieSpawn.setPosition(pos.getX(), pos.getY(), pos.getZ())
			zombieSpawn.spawn()
			zombieSpawn.spawn()
			zombieSpawn.spawn()
		  });
})
// breaking spawners in nether will spawn a monster box - 75% chance
onEvent("lootjs", (event) => {
	event
		.addBlockLootModifier("minecraft:spawner")
		.anyDimension("minecraft:the_nether") 
        .randomChance(0.75)
		.thenApply((context) => {
			var level = context.level
			var pos = context.blockPos
			var block = level.getBlock(pos)
	  
			block.set('dubl:monster_box')
		  });
})
//
//
//
//
//
// adds dimdungeons key to all lootchests in overworld dimension - 5% chance
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.CHEST)
		.anyDimension("minecraft:overworld") 
        .randomChance(0.05) 
		.thenAdd("dubl:item_portal_key");
});
// adds dimdungeons key to all lootchests in mining dimension - 10% chance
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.CHEST)
		.anyDimension("mining_dimension:mining") 
        .randomChance(0.1) 
		.thenAdd("dubl:item_portal_key");
});
// adds dimdungeons key to all lootchests in nether - 10% chance
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.CHEST)
		.anyDimension("minecraft:the_nether") 
        .randomChance(0.1) 
		.thenAdd("dubl:item_portal_key");
});
// adds dimdungeons key to all lootchests in planet dimensions - 15% chance
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.CHEST)
		.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus") 
        .randomChance(0.15) 
		.thenAdd("dubl:item_portal_key");
});
//
//
//
//
//
// adds explorer's journals to all lootchests - 5.0% chance
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.CHEST)
        .randomChance(0.05) 
		.thenAdd("dubl:explorers_journal");
});
//
//
//
//
//
//
//
//
//
//
// adds temple key to all lootchests in planet dimensions - 1.0% chance
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.CHEST)
		.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus") 
        .randomChance(0.01) 
		.thenAdd("dubl:temple_key");
});
//
//
//
//
//
// adds mob essences to all lootchests in planet dimensions - .1% chance
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.CHEST)
		.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus") 
        .randomChance(0.001) 
		.thenAdd("dubl:zombie_essence");
});
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.CHEST)
		.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus") 
        .randomChance(0.001) 
		.thenAdd("dubl:skeleton_essence");
});
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.CHEST)
		.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus") 
        .randomChance(0.001) 
		.thenAdd("dubl:creeper_essence");
});
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.CHEST)
		.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus") 
        .randomChance(0.001) 
		.thenAdd("dubl:spider_essence");
});
// special essence - 1% chance
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.CHEST)
		.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus") 
        .randomChance(0.01) 
		.thenAdd("dubl:special_essence");
});
//
//
//
//
//
// adds soul essences to all lootchests in planet dimensions and the end - 0.1% chance
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.CHEST)
		.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus", "minecraft:the_end") 
        .randomChance(0.001) 
		.thenAdd("dubl:soul_essence_rarity_uncommon");
});
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.CHEST)
		.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus", "minecraft:the_end") 
        .randomChance(0.001) 
		.thenAdd("dubl:soul_essence_rarity_rare");
});
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.CHEST)
		.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus", "minecraft:the_end") 
        .randomChance(0.001) 
		.thenAdd("dubl:soul_essence_rarity_epic");
});
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.CHEST)
		.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus", "minecraft:the_end") 
        .randomChance(0.001) 
		.thenAdd("dubl:soul_essence_gear_gun");
});
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.CHEST)
		.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus", "minecraft:the_end") 
        .randomChance(0.001) 
		.thenAdd("dubl:soul_essence_gear_helmet");
});
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.CHEST)
		.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus", "minecraft:the_end") 
        .randomChance(0.001) 
		.thenAdd("dubl:soul_essence_gear_chest");
});
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.CHEST)
		.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus", "minecraft:the_end") 
        .randomChance(0.001) 
		.thenAdd("dubl:soul_essence_gear_pants");
});
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.CHEST)
		.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus", "minecraft:the_end") 
        .randomChance(0.001) 
		.thenAdd("dubl:soul_essence_gear_boots");
});
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.CHEST)
		.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus", "minecraft:the_end") 
        .randomChance(0.001) 
		.thenAdd("dubl:soul_essence_gear_ring");
});
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.CHEST)
		.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus", "minecraft:the_end") 
        .randomChance(0.001) 
		.thenAdd("dubl:soul_essence_gear_necklace");
});
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.CHEST)
		.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus", "minecraft:the_end") 
        .randomChance(0.001) 
		.thenAdd("dubl:soul_essence_gear_scepter");
});
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.CHEST)
		.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus", "minecraft:the_end") 
        .randomChance(0.001) 
		.thenAdd("dubl:soul_essence_gear_staff");
});
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.CHEST)
		.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus", "minecraft:the_end") 
        .randomChance(0.001) 
		.thenAdd("dubl:soul_essence_gear_axe");
});
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.CHEST)
		.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus", "minecraft:the_end") 
        .randomChance(0.001) 
		.thenAdd("dubl:soul_essence_gear_sword");
});
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.CHEST)
		.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus", "minecraft:the_end") 
        .randomChance(0.001) 
		.thenAdd("dubl:soul_essence_gear_blaster");
});
//
//
//
//
// adds loot to ALL loot tables in the nether
	onEvent("lootjs", (event) => {
		event
			.addLootTypeModifier(LootType.CHEST)
			.anyDimension("minecraft:the_nether") 
			.randomChance(0.3) 
			.thenApply(ctx => {
				ctx.addLoot(Item.of("betternether:cincinnasite", randomBetween(1, 8)));
			});
	});
	onEvent("lootjs", (event) => {
		event
			.addLootTypeModifier(LootType.CHEST)
			.anyDimension("minecraft:the_nether") 
			.randomChance(0.2) 
			.thenApply(ctx => {
				ctx.addLoot(Item.of("betternether:cincinnasite_ingot", randomBetween(1, 4)));
			});
	});
	onEvent("lootjs", (event) => {
		event
			.addLootTypeModifier(LootType.CHEST)
			.anyDimension("minecraft:the_nether") 
			.randomChance(0.3) 
			.thenApply(ctx => {
				ctx.addLoot(Item.of("betternether:nether_ruby", randomBetween(1, 4)));
			});
	});
//
//
//
//
// adds loot to ALL loot tables in planet dimensions and the end
  onEvent("lootjs", (event) => {
	  event
	  	.addLootTypeModifier(LootType.CHEST)
		  .anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus", "minecraft:the_end") 
		  .randomChance(0.1) 
		  .thenApply(ctx => {
			  ctx.addLoot(Item.of("minecraft:emerald", randomBetween(1, 16)));
		  });
  });
  onEvent("lootjs", (event) => {
	event
		.addLootTypeModifier(LootType.CHEST)
		.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus", "minecraft:the_end") 
		.randomChance(0.1) 
		.thenApply(ctx => {
			ctx.addLoot(Item.of("minecraft:iron_ingot", randomBetween(1, 16)));
		});
	});
	onEvent("lootjs", (event) => {
		event
			.addLootTypeModifier(LootType.CHEST)
			.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus", "minecraft:the_end") 
			.randomChance(0.03) 
			.thenApply(ctx => {
				ctx.addLoot(Item.of("minecraft:diamond", randomBetween(1, 8)));
			});
		});
	onEvent("lootjs", (event) => {
		event
			.addLootTypeModifier(LootType.CHEST)
			.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus", "minecraft:the_end") 
			.randomChance(0.001) 
			.thenAdd("mmorpg:full_favor");
	});
	onEvent("lootjs", (event) => {
		event
			.addLootTypeModifier(LootType.CHEST)
			.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus", "minecraft:the_end") 
			.randomChance(0.05) 
			.thenApply(ctx => {
				ctx.addLoot(Item.of("mmorpg:currency/orb_of_transmutation", randomBetween(1, 3)));
			});
		});
	onEvent("lootjs", (event) => {
		event
			.addLootTypeModifier(LootType.CHEST)
			.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus", "minecraft:the_end") 
			.randomChance(0.03) 
			.thenApply(ctx => {
				ctx.addLoot(Item.of("mmorpg:currency/randomize_affixes", randomBetween(1, 2)));
			});
		});
	onEvent("lootjs", (event) => {
		event
			.addLootTypeModifier(LootType.CHEST)
			.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus", "minecraft:the_end") 
			.randomChance(0.01) 
			.thenAdd("mmorpg:currency/crystal_of_purification");
		});
	onEvent("lootjs", (event) => {
		event
			.addLootTypeModifier(LootType.CHEST)
			.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus", "minecraft:the_end") 
			.randomChance(0.02) 
			.thenApply(ctx => {
				ctx.addLoot(Item.of("mmorpg:currency/reroll_affix_numbers", randomBetween(1, 2)));
			});
		});
	onEvent("lootjs", (event) => {
		event
			.addLootTypeModifier(LootType.CHEST)
			.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus", "minecraft:the_end") 
			.randomChance(0.001) 
			.thenAdd("mmorpg:currency/stone_of_hope");
		});
	onEvent("lootjs", (event) => {
		event
			.addLootTypeModifier(LootType.CHEST)
			.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus", "minecraft:the_end") 
			.randomChance(0.01) 
			.thenApply(ctx => {
				ctx.addLoot(Item.of("mmorpg:currency/reroll_primary_stats_numbers", randomBetween(1, 2)));
			});
		});
	onEvent("lootjs", (event) => {
		event
			.addLootTypeModifier(LootType.CHEST)
			.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus", "minecraft:the_end") 
			.randomChance(0.005) 
			.thenAdd("mmorpg:currency/number_reroll");
		});
	onEvent("lootjs", (event) => {
		event
			.addLootTypeModifier(LootType.CHEST)
			.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus", "minecraft:the_end") 
			.randomChance(0.001) 
			.thenAdd("mmorpg:currency/reroll_unique_numbers");
		});
	onEvent("lootjs", (event) => {
		event
			.addLootTypeModifier(LootType.CHEST)
			.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus", "minecraft:the_end") 
			.randomChance(0.01) 
			.thenAdd("mmorpg:currency/clear_instability");
		});
	onEvent("lootjs", (event) => {
		event
			.addLootTypeModifier(LootType.CHEST)
			.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus", "minecraft:the_end") 
			.randomChance(0.01) 
			.thenAdd("mmorpg:currency/orb_of_corruption");
		});
	onEvent("lootjs", (event) => {
		event
			.addLootTypeModifier(LootType.CHEST)
			.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus", "minecraft:the_end") 
			.randomChance(0.005) 
			.thenAdd("mmorpg:currency/orb_of_infinity");
		});
	onEvent("lootjs", (event) => {
		event
			.addLootTypeModifier(LootType.CHEST)
			.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus", "minecraft:the_end") 
			.randomChance(0.05) 
			.thenAdd("mmorpg:currency/plus_one_upgrade");
		});
	onEvent("lootjs", (event) => {
		event
			.addLootTypeModifier(LootType.CHEST)
			.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus", "minecraft:the_end") 
			.randomChance(0.04) 
			.thenAdd("mmorpg:currency/plus_two_upgrade");
		});
	onEvent("lootjs", (event) => {
		event
			.addLootTypeModifier(LootType.CHEST)
			.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus", "minecraft:the_end") 
			.randomChance(0.01) 
			.thenAdd("mmorpg:currency/plus_three_upgrade");
		});

//
//
//
//
// adds dungeon coins to mob drops in dungeon dimension
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.ENTITY)
		.anyDimension("dimdungeons:dungeon_dimension") 
        .randomChance(0.25)
		.thenApply(ctx => {
			ctx.addLoot(Item.of("dubl:dungeon_coin", randomBetween(1, 6)));
		});
});
//
//
//
//
//
// adds mob essences to mob drops in dungeon dimension - 0.5%
onEvent("lootjs", (event) => {
    event
		.addEntityLootModifier("specialmobs:zombie")
		.anyDimension("dimdungeons:dungeon_dimension") 
        .randomChance(0.005) 
		.thenAdd("dubl:zombie_essence");
});
onEvent("lootjs", (event) => {
    event
		.addEntityLootModifier("specialmobs:skeleton")
		.anyDimension("dimdungeons:dungeon_dimension") 
        .randomChance(0.005) 
		.thenAdd("dubl:skeleton_essence");
});
onEvent("lootjs", (event) => {
    event
		.addEntityLootModifier("specialmobs:creeper")
		.anyDimension("dimdungeons:dungeon_dimension") 
        .randomChance(0.005) 
		.thenAdd("dubl:creeper_essence");
});
onEvent("lootjs", (event) => {
    event
		.addEntityLootModifier("specialmobs:spider")
		.anyDimension("dimdungeons:dungeon_dimension") 
        .randomChance(0.005) 
		.thenAdd("dubl:spider_essence");
});
onEvent("lootjs", (event) => {
    event
		.addEntityLootModifier("specialmobs:blaze")
		.anyDimension("dimdungeons:dungeon_dimension") 
        .randomChance(0.005) 
		.thenAdd("dubl:blaze_essence");
});
onEvent("lootjs", (event) => {
    event
		.addEntityLootModifier("specialmobs:witherskeleton")
		.anyDimension("dimdungeons:dungeon_dimension") 
        .randomChance(0.005) 
		.thenAdd("dubl:wither_essence");
});
//
//
//
//
//
// breaking spawners in dungeon dimension will drop dungeon coins
onEvent("lootjs", (event) => {
    event
		.addBlockLootModifier("minecraft:spawner")
		.anyDimension("dimdungeons:dungeon_dimension") 
        .randomChance(0.75) 
		.thenApply(ctx => {
			ctx.addLoot(Item.of("dubl:dungeon_coin", randomBetween(1, 16)));
		});
});
//
//
//
//
//
//
//
//
//
//
// loot bag and key drops
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.ENTITY)
		.killedByPlayer()
        .randomChance(0.075)
		.thenAdd("dubl:loot_bag");
});

onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.ENTITY)
		.killedByPlayer()
		.anyDimension("minecraft:overworld", "mining_dimension:mining", "minecraft:the_nether", "dimdungeons:dungeon_dimension", "boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus", "minecraft:the_end", "moolands:moolands") 
        .randomChance(0.03) 
		.thenAdd("dubl:key_iron");
});

// overworld
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.ENTITY)
		.killedByPlayer()
		.anyDimension("minecraft:overworld") 
        .randomChance(0.01) 
		.thenAdd("dubl:key_gold");
});
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.ENTITY)
		.killedByPlayer()
		.anyDimension("minecraft:overworld") 
        .randomChance(0.001) 
		.thenAdd("dubl:key_diamond");
});
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.ENTITY)
		.killedByPlayer()
		.anyDimension("minecraft:overworld") 
        .randomChance(0.0001) 
		.thenAdd("dubl:key_netherite");
});
//
// mining dimension
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.ENTITY)
		.killedByPlayer()
		.anyDimension("mining_dimension:mining") 
        .randomChance(0.02) 
		.thenAdd("dubl:key_gold");
});
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.ENTITY)
		.killedByPlayer()
		.anyDimension("mining_dimension:mining") 
        .randomChance(0.01) 
		.thenAdd("dubl:key_diamond");
});
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.ENTITY)
		.killedByPlayer()
		.anyDimension("mining_dimension:mining") 
        .randomChance(0.001) 
		.thenAdd("dubl:key_netherite");
});
//
// nether
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.ENTITY)
		.killedByPlayer()
		.anyDimension("minecraft:the_nether") 
        .randomChance(0.03) 
		.thenAdd("dubl:key_gold");
});
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.ENTITY)
		.killedByPlayer()
		.anyDimension("minecraft:the_nether") 
        .randomChance(0.02) 
		.thenAdd("dubl:key_diamond");
});
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.ENTITY)
		.killedByPlayer()
		.anyDimension("minecraft:the_nether") 
        .randomChance(0.005) 
		.thenAdd("dubl:key_netherite");
});
//
// dungeon dimension
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.ENTITY)
		.killedByPlayer()
		.anyDimension("dimdungeons:dungeon_dimension") 
        .randomChance(0.03) 
		.thenAdd("dubl:key_gold");
});
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.ENTITY)
		.killedByPlayer()
		.anyDimension("dimdungeons:dungeon_dimension") 
        .randomChance(0.03) 
		.thenAdd("dubl:key_diamond");
});
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.ENTITY)
		.killedByPlayer()
		.anyDimension("dimdungeons:dungeon_dimension") 
        .randomChance(0.01) 
		.thenAdd("dubl:key_netherite");
});
//
// planet dimensions
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.ENTITY)
		.killedByPlayer()
		.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus") 
        .randomChance(0.04) 
		.thenAdd("dubl:key_gold");
});
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.ENTITY)
		.killedByPlayer()
		.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus") 
        .randomChance(0.04) 
		.thenAdd("dubl:key_diamond");
});
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.ENTITY)
		.killedByPlayer()
		.anyDimension("boss_tools:moon", "boss_tools:mars", "boss_tools:mercury", "boss_tools:venus") 
        .randomChance(0.01) 
		.thenAdd("dubl:key_netherite");
});
//
// end dimension
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.ENTITY)
		.killedByPlayer()
		.anyDimension("minecraft:the_end") 
        .randomChance(0.05) 
		.thenAdd("dubl:key_gold");
});
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.ENTITY)
		.killedByPlayer()
		.anyDimension("minecraft:the_end") 
        .randomChance(0.05) 
		.thenAdd("dubl:key_diamond");
});
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.ENTITY)
		.killedByPlayer()
		.anyDimension("minecraft:the_end") 
        .randomChance(0.03) 
		.thenAdd("dubl:key_netherite");
});
//
// moolands
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.ENTITY)
		.killedByPlayer()
		.anyDimension("moolands:moolands") 
        .randomChance(0.05) 
		.thenAdd("dubl:key_diamond");
});
onEvent("lootjs", (event) => {
    event
		.addLootTypeModifier(LootType.ENTITY)
		.killedByPlayer()
		.anyDimension("moolands:moolands") 
        .randomChance(0.05) 
		.thenAdd("dubl:key_netherite");
});



// onEvent("lootjs", (event) => {
//     event
// 		.addLootTypeModifier(LootType.ENTITY)
// 		.anyDimension("dimdungeons:dungeon_dimension")
// 		.playerPredicate((player) => player.stages.has("sadge"))
// 		.randomChance(0.75) 
// 		.thenAdd("dubl:bovine_bardiche");
// });