Good Day!
I'm currently working on a mod that changes the global loot of many ores in game to give additional drops. Some ores like Ancient Debris has an entire change where it no longer drops itself when mined. However, I want the block to drop extra when mined with Fortune and drop itself when mined with Silk Touch.
However, I currently don't know how to work on this change.
I'd really appreciate any help!
CODE:
protected List<ItemStack> doApply(List<ItemStack> generatedLoot, LootContext context) {
generatedLoot.clear();
generatedLoot.add(new ItemStack(addition, 1));
if(context.getRandom().nextFloat() > 0.6) {
generatedLoot.add(new ItemStack(addition, 1));
}if(context.getRandom().nextFloat() > 0.6) {
generatedLoot.add(new ItemStack(addition, 2));
}if(context.getParam(LootContextParams.TOOL).isEnchanted())
return generatedLoot;
}
Best Regards!