Package net.fabricmc.fabric.api.item.v1
Enum Class EnchantmentSource
- All Implemented Interfaces:
Serializable
,Comparable<EnchantmentSource>
,Constable
Determines where an enchantment has been loaded from.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns whether this enchantment source is builtin and bundled in the vanilla or mod resources.static EnchantmentSource
Returns the enum constant of this class with the specified name.static EnchantmentSource[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
VANILLA
An enchantment loaded from the vanilla data pack. -
MOD
An enchantment loaded from mods' bundled resources.This includes the additional builtin data packs registered by mods with Fabric Resource Loader.
-
DATA_PACK
An enchantment loaded from an external data pack.
-
-
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
-
isBuiltin
public boolean isBuiltin()Returns whether this enchantment source is builtin and bundled in the vanilla or mod resources.- Returns:
true
if builtin,false
otherwise
-