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 ConstantsEnum ConstantDescriptionThe enchantment is written directly to the output item'sDataComponents.ENCHANTMENTScomponent (used for active equipment).The enchantment is written to the output item'sDataComponents.STORED_ENCHANTMENTScomponent (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
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<EnchantmentAttachment> The serialization codec for encoding and decodingEnchantmentAttachmentvalues by name.Fields inherited from interface net.minecraft.util.StringRepresentable
PRE_BUILT_MAP_THRESHOLD -
Method Summary
Modifier and TypeMethodDescription@NotNull StringRetrieves the serialized string representation of this attachment mode.static EnchantmentAttachmentReturns the enum constant of this class with the specified name.static EnchantmentAttachment[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
STORED
The enchantment is written to the output item'sDataComponents.STORED_ENCHANTMENTScomponent (used for catalyst items such as Enchanted Books, Enchanted Pages, and Enchanted Tomes). -
APPLIED
The enchantment is written directly to the output item'sDataComponents.ENCHANTMENTScomponent (used for active equipment). -
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
-
CODEC
The serialization codec for encoding and decodingEnchantmentAttachmentvalues by name.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
getSerializedName
Retrieves the serialized string representation of this attachment mode.- Specified by:
getSerializedNamein interfacenet.minecraft.util.StringRepresentable- Returns:
- The serialized name string.
-