Baked Enchants
Baked Enchants is a reimplementation of the "Fortunate Gold" feature from the Quarks mod, commissioned by Foreck1 specifically for use in the Rebirth of the Night (RotN) modpack.
Mod Capabilities
This addon allows users to pre-configure specific enchantments that will be automatically applied to items by default. Enchantments set this way will appear on items when retrieved from Creative or JEI inventories, looted from monsters or chests, or crafted through standard and modded crafting processes.
Important to note: items with built-in enchantments can be enchanted further as usual, with more powerful enchantments or incompatible spells replacing the base ones.
By default, the mod grants golden pickaxes Fortune II and golden swords — Looting II.
Configuration and Integration
To expand the list of items with built-in enchantments, integration methods are offered via CraftTweaker or GroovyScript.
CraftTweaker
javascript</p> <pre><code class="language-python"> import mods.bakedenchants.BakedEnchants; // Adding fixed enchantments to an item // BakedEnchants.add(IItemStack, IEnchantment...) BakedEnchants.add(<minecraft:iron_sword:*>, <enchantment:minecraft:sharpness>.makeEnchantment(5)); BakedEnchants.add(<minecraft:iron_sword:*>, <enchantment:minecraft:sharpness>.makeEnchantment(5), <enchantment:minecraft:unbreaking>.makeEnchantment(2)); // Removing all built-in enchantments from an item // BakedEnchants.remove(IItemStack) BakedEnchants.remove(<minecraft:golden_pickaxe:*>); // Clearing all items with preset enchantments BakedEnchants.removeAll();\`\`\` ### GroovyScript \`\`\`java perl
import mods.bakedenchants.BakedEnchants
// Adding a single baked enchantment
// BakedEnchants.add(ItemStack, Enchantment, int)
BakedEnchants.add(item('minecraft:iron_sword:'), enchantment('minecraft:sharpness'), 5)
// Applying multiple preset enchantments at once
// BakedEnchants.add(ItemStack, Map<Enchantment, Integer>)
BakedEnchants.add(item('minecraft:iron_sword:'), [
(enchantment('minecraft:looting')): 2,
(enchantment('minecraft:sharpness')): 5
])
// Clearing enchantments from selected item
// BakedEnchants.remove(ItemStack)
BakedEnchants.remove(item('minecraft:golden_pickaxe:*'))
// Removing all items with preset enchants
BakedEnchants.removeAll()```
## Authorship
Logo design made by Foreck.