#Modifying enchantment values + calculations

1 messages · Page 1 of 1 (latest)

fast dock
#

In my quest to rebalance the game to my liking in a modpack I've been working on I managed to momentarily remove the ability for certain enchantments to be applied to any item (minus creative mode bypass).

However now a thought came to my head regarding how the likes of Fortune have certain multipliers applied per level. To be more precise:
Fortune I -> +33% average
Fortune II -> +75% average
Fortune III -> +120% average
at least when solely based on ore drops
Instead I was considering to adjust these values one way or another even if it's a lot more complicated than initially expected

For reference I might as well share how I went about "disabling" enchantments in the first place (KubeJS used to autoload datapacks):
under \minecraft\kubejs\data\minecraft\enchantment

  "anvil_cost": 4,
  "description": {
    "translate": "enchantment.minecraft.fortune"
  },
  "exclusive_set": "#minecraft:exclusive_set/mining",
  "max_cost": {
    "base": 65,
    "per_level_above_first": 9
  },
  "max_level": 3,
  "min_cost": {
    "base": 15,
    "per_level_above_first": 9
  },
  "slots": [
    "mainhand"
  ],
  "supported_items": "#minecraft:empty",
  "weight": 2
}```
lunar lichenBOT
#

<@&1201956957406109788>

Someone will come and help soon!

💬 While you wait, take this time to provide more context and details.

🙇 If nobody has answered you by <t:1742489589:t>, feel free to use the Summon Helpers button to ping our helper team.

✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve

wooden epoch
#

The fortune enchantment itself doesn't really do anything, all the loot tables that it applies to simply check if the tool has fortune and then calculate how many extra to drop based on a hardcoded formula. You can however replace that with a uniform or binomial distribution, it just wouldn't account for level on its own; you'd need a separate function and condition in the loot table for each level

#

Not particularly hard, but tedious

fast dock
#

I expected nothing less but it being hard-coded after all
Now to figure out how to go about the second part of your answer as I obviously lack some of the needed knowledge to know exactly what all this truly means

#

looking at it I do see a formula named "minecraft:ore_drops" being applied to any of the related blocks

#

I may have figured it out for the moment but will keep it up still in the event something pops up I need additional assistance for