promotional banner

DelightoFlightArcFix

You can set which targets DO NOT get shocked by Delight o' Flight's Arc Buff by config!

Delight o' Flight Fix (delighto_flight_fix)

Introduction

This mod is a fix add-on for Delight o' Flight. Delight o' Flight's "Arc" effect shocks nearby mobs, but the original mod has no entity protection at all, so passive mobs (villagers, cows, sheep, etc.) are frequently killed by accident. This mod does just one thing: it adds a configurable blacklist mechanism so modpack authors can decide which mobs won't be shocked.

Dependencies

  • Farmer's Delight 1.20.1-1.3.1
  • Delight o' Flight 1.20.1-1.3.4

Features

The blacklist (entity IDs or entity tags) works on three levels at once for complete interception:

  1. When a blacklisted mob holds the Arc effect — no arc (lightning) is spawned at all.
  2. When a blacklisted mob is the victim — it is not shocked (no damage, no sound).
  3. On the client render layer — no arc is drawn toward blacklisted mobs (no visuals).

Configuration

The config file is located at: config/delighto_flight_fix-common.toml

  • shockBlacklist: a list of strings. Each entry can be:
    • An entity type ID, e.g. minecraft:villager
    • An entity type tag (prefixed with #), e.g. #minecraft:raiders Invalid entries are ignored. By default, the list already covers 35 passive mobs, including villagers, wandering traders, cows, sheep, pigs, chickens, cats, dogs, horses, ocelots, trader llamas, iron golems, snow golems, zombie horses, skeleton horses, polar bears, sniffers, striders, tadpoles, frogs, camels, dolphins, goats, axolotls, and aerolopes.

Development / Building

  • Run in a dev environment: ./gradlew runClient (or genIntellijRuns then run from your IDE).
  • Build: ./gradlew jar, output in build/libs/.

Technical Notes (must-read for maintainers)

This mod uses Mixin to modify Delight o' Flight's classes, injecting into three third-party mod classes. There are several non-obvious gotchas, all handled as follows:

  1. Mixin targets (src/main/java/com/garam/DelightoFlightFix/mixin/):

    • ArcEffectMixin: injects into ArcEffect.applyEffectTick, cancels arc spawning when the holder is blacklisted.
    • ElectricCurrentMixin: redirects getEntitiesOfClass inside ElectricCurrent.tick to filter victims.
    • ElectricCurrentRendererMixin (client): redirects the renderer's getTargets query to filter arc visuals.
  2. Mixin registration: Forge 1.20.1 does not support the [[mixins]] section in mods.toml. In dev, registration happens via the --mixin.config argument in the run configuration; the production jar relies on the MixinConfigs manifest attribute.

  3. This mod's refmap is hand-written (delighto_flight_fix.refmap.json): The Mixin annotation processor cannot generate a refmap for third-party mod classes (it only does direct lookups in vanilla SRG mappings). So this mod's refmap is written by hand; the SRG names were confirmed by decompiling the obfuscated Delight o' Flight jar.

    • ArcEffect.applyEffectTick -> m_6742_
    • ElectricCurrent.tick -> m_8119_
    • Level.getEntitiesOfClass -> m_45976_

    Note that refmap keys come in two formats — getting them wrong causes a failed injection check (0/1) error in production:

    • method attributes (e.g. tick, applyEffectTick) use the method name as the key.
    • @At INVOKE targets (e.g. getEntitiesOfClass) use the full method reference (Lowner;name(desc)ret) as the key.

    If you upgrade Delight o' Flight, you must re-verify these SRG names and update the refmap.

Code Structure

  • com.garam.DelightoFlightFix.DelightoFlightFix: main class, registers the config.
  • com.garam.DelightoFlightFix.Config: blacklist config and lookup logic (isShockBlacklisted).
  • com.garam.DelightoFlightFix.mixin: the three Mixin classes.

License / Credits

  • Author: Garam
  • Delight o' Flight: © cloudmeow. This mod is a compatibility fix only; no part of its code is modified or redistributed.

The DelightoFlightArcFix Team

profile avatar
  • 1
    Projects
  • 19
    Downloads