All Known Implementing Classes:
EnchantAction.Apply, EnchantAction.None, EnchantAction.Reroll, EnchantAction.Transfer, EnchantAction.Upgrade

A sealed interface defining the concrete mutation operations that can be performed by the Enchanting Altar upon the player's inventory.

Acts as the Command Pattern interface for menu interactions. Each valid implementation manages its own specific logic for modifying the target item, deducting resource costs, and handling source catalyst consumption.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final record 
    Action representing a newly generated enchantment randomly supplied by the table itself.
    static final record 
    A non-action representing a slot that is visually present but functionally disabled.
    static final record 
    Action representing a manual re-roll of the table's deterministic seed.
    static final record 
    Action representing the transfer of an enchantment from a source book to the target item.
    static final record 
    Action representing an upgrade to an existing enchantment on the target item.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    execute(net.minecraft.world.entity.player.Player player, net.minecraft.world.Container inventory)
    Executes the enchantment action, modifying the container and player state.
  • Method Details

    • execute

      boolean execute(net.minecraft.world.entity.player.Player player, net.minecraft.world.Container inventory)
      Executes the enchantment action, modifying the container and player state.
      Parameters:
      player - The player executing the action.
      inventory - The active inventory container holding the target, fuel, and source.
      Returns:
      true if the action was successfully performed, false if it failed (e.g., due to insufficient funds).