
lightning enchant
it adds an enchanting book with name lightning shot and you can place it only on mace and swords it works o fabric version 1.21.1 and when you hit any mob...
00—FreefabricBoth1.21.1mod
Lightning Shot adds a single-level enchantment for maces and all sword tiers. An enchanted hit calls down a vanilla lightning bolt on the struck mob.
- The enchantment is registered via the 1.21 definition API and limited to the hand slots for swords/mace, so it cannot be applied elsewhere. It appears in the Combat creative tab as a ready-made enchanted book.
- Attack handling listens to
AttackEntityCallbackon the server; if the attacker’s held item carries Lightning Shot, the target is struck by lightning at mid-height. Channeler is set when a server player attacks so advancement/credit flows correctly. - Costs/weight are tuned for standard table rolls (weight 10, single level, moderate enchant/anvil costs).
Known limitations and notes:
- Only fires on direct melee swings; projectiles or indirect damage won’t trigger it.
- Lightning uses vanilla behavior (damage, fire setting, and weather checks), so expect normal fire spread and pig/zombie-piglin conversions in overworld conditions.