Enum Class EnchantmentAttachment

java.lang.Object
java.lang.Enum<EnchantmentAttachment>
johnsmith.enchantingoverhauled.api.enchantment.recipe.EnchantmentAttachment
All Implemented Interfaces:
Serializable, Comparable<EnchantmentAttachment>, Constable, net.minecraft.util.StringRepresentable

public enum EnchantmentAttachment extends Enum<EnchantmentAttachment> implements net.minecraft.util.StringRepresentable
Defines how an enchantment is attached to the resulting output item when an EnchantRecipe transmutation occurs (e.g., in the Enchanting Altar, Anvil, Tome Bartering, or Random Loot Functions).
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>

    Nested classes/interfaces inherited from interface net.minecraft.util.StringRepresentable

    net.minecraft.util.StringRepresentable.EnumCodec<E extends Enum<E> & net.minecraft.util.StringRepresentable>, net.minecraft.util.StringRepresentable.StringRepresentableCodec<S extends net.minecraft.util.StringRepresentable>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    The enchantment is written directly to the output item's DataComponents.ENCHANTMENTS component (used for active equipment).
    The enchantment is written to the output item's DataComponents.STORED_ENCHANTMENTS component (used for catalyst items such as Enchanted Books, Enchanted Pages, and Enchanted Tomes).
    The enchantment is consumed by the transmutation process and discarded, leaving the output item without enchantment components (used for transmutations like Golden Apple to Enchanted Golden Apple or Splash Potion to Bottle o' Enchanting).
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<EnchantmentAttachment>
    The serialization codec for encoding and decoding EnchantmentAttachment values by name.

    Fields inherited from interface net.minecraft.util.StringRepresentable

    PRE_BUILT_MAP_THRESHOLD
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull String
    Retrieves the serialized string representation of this attachment mode.
    Returns the enum constant of this class with the specified name.
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • STORED

      public static final EnchantmentAttachment STORED
      The enchantment is written to the output item's DataComponents.STORED_ENCHANTMENTS component (used for catalyst items such as Enchanted Books, Enchanted Pages, and Enchanted Tomes).
    • APPLIED

      public static final EnchantmentAttachment APPLIED
      The enchantment is written directly to the output item's DataComponents.ENCHANTMENTS component (used for active equipment).
    • VOID

      public static final EnchantmentAttachment VOID
      The enchantment is consumed by the transmutation process and discarded, leaving the output item without enchantment components (used for transmutations like Golden Apple to Enchanted Golden Apple or Splash Potion to Bottle o' Enchanting).
  • Field Details

  • Method Details

    • values

      public static EnchantmentAttachment[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static EnchantmentAttachment valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getSerializedName

      @NotNull public @NotNull String getSerializedName()
      Retrieves the serialized string representation of this attachment mode.
      Specified by:
      getSerializedName in interface net.minecraft.util.StringRepresentable
      Returns:
      The serialized name string.