Fixes and balance tools for the Lucky Block mod (Forge 1.20.1).
The Lucky Block mod reads a broken block's Luck after the block has been removed from the world, so player breaks always roll at luck 0. Luck crafting, natural lucky/unlucky structures and custom Luck values then have no effect. Lucky Tweaks captures the real Luck at break time and injects it into the drop roll. No changes to the Lucky Block jar.
Luck bonuses are expressed as a single Chance %, so the same number means the same thing on every block: +100% always targets that block's best possible outcome, -100% its worst. Other mods and scripts contribute Chance through the API (the Lucky Ring, Lucky Belt and the invasion penalty all go through it), and it's translated into each block's own Luck behind the scenes.
Every option below can be set from the mod list config button, with no file editing. The screen lists every lucky block it detects and gives each one its own controls (cap, spawn rule, on/off).
Cap any lucky block's positive luck (negative luck is never capped):
# config/luckytweaks-common.toml
luckCaps = ["lucky:lucky_block=60"]
The cap applies to the break roll, the luck crafting result and the crafting preview, so the tooltip always matches the actual roll. Reloadable, and overrides caps registered through the API.
Switch off specific lucky blocks. A disabled block no longer generates, and breaking an existing one fires no effect: it drops back as an item with its Luck kept. Covers the base block, addon blocks and cross-mod lucky blocks.
Lucky Swords, Bows and Potions fire a lucky-block effect on hit, and some of those effects hurt the wielder. When enabled, harmful effects (TNT, lightning, lava, fire, cobweb) are removed from the on-hit roll with a chance that rises with the weapon's Luck, down to about 1% at +100. Offensive and beneficial effects are kept, and lucky blocks are never touched. Configurable.
A crafting recipe that combines two or more lucky blocks of the same type into one, with their Luck values added (bounded by the block's cap and an overall +/- 100 limit). Works with stacks and shift-click for batches.
Reads the NBT markers a pack injects into its drop tables to recognise its rarest "legendary" drops and its nastiest "cursed" ones. A legendary draw fires a server-wide fanfare (sound + particles); both feed the legendary/cursed counters on the Lucky Stats screen. The Lucky Totem's boost and curse hook into the same markers.
Shows a configurable line (the modpack name and version) at the bottom of the title screen. One config file, no rebuild.
For runs and contests where legitimacy matters. A per-player seal records, on the Lucky Stats screen, whether a run used creative or spectator, had cheats enabled, ran outside hardcore, used a non-default Lucky Tweaks config, or had its save edited. Once a flag is set it stays set, and the record is checksummed so basic save editing is detectable. As with any client-side check it can be bypassed by a determined modder, so host contests on a server for full assurance. Requires Lucky Stats.
With JEI installed, example recipes are generated for every registered lucky block and luck-crafting ingredient (luck crafting and fusion are dynamic recipes JEI cannot display on its own).
com.lwi.luckytweaks.api.LuckyTweaksApi:
addChance(int): contribute Chance % to the current break (call from a BlockEvent.BreakEvent handler at priority HIGH or below)addTopReroll(): grant one re-roll toward the block's top tierregisterLuckCap(blockId, max) / getLuckCap(blockId) / getCapturedLuck() / getContributedChance()registerBreakListener(...), isLuckyBlock(...), getLuckyBlockIds(...), plus the LEG_TAG / CURSE_TAG drop markersUsable from KubeJS server scripts via Java.loadClass.
Requires Lucky Block. Optional: JEI (recipe display), Lucky Stats (run integrity seal). Built for Lucky World Invasion - Hardcore.