Class EnchantmentCodecMixin

java.lang.Object
johnsmith.enchantmentcore.mixin.enchantment.EnchantmentCodecMixin

public class EnchantmentCodecMixin extends Object
Mixin targeting the static initialization of the Enchantment class.

Purpose: This mixin intercepts and replaces the static DIRECT_CODEC of the Enchantment class. The replacement codec acts as a "man-in-the-middle" to enable dynamic, JSON-driven configuration and perform pre-instantiation tree transformations like auto-wiring LBV pointers.

  • Field Details

    • DIRECT_CODEC

      public static com.mojang.serialization.Codec<net.minecraft.world.item.enchantment.Enchantment> DIRECT_CODEC
      Shadow reference to the vanilla Enchantment codec. Marked as Mutable to allow reassignment during the static initialization phase.
  • Constructor Details

    • EnchantmentCodecMixin

      public EnchantmentCodecMixin()