Record Class RunFunction
java.lang.Object
java.lang.Record
net.minecraft.world.item.enchantment.effects.RunFunction
- All Implemented Interfaces:
EnchantmentEntityEffect
,EnchantmentLocationBasedEffect
public record RunFunction(ResourceLocation function)
extends Record
implements EnchantmentEntityEffect
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec
<RunFunction> private final ResourceLocation
The field for thefunction
record component.private static final org.slf4j.Logger
-
Constructor Summary
ConstructorDescriptionRunFunction
(ResourceLocation function) Creates an instance of aRunFunction
record class. -
Method Summary
Modifier and TypeMethodDescriptionvoid
apply
(ServerLevel p_346152_, int p_344788_, EnchantedItemInUse p_344801_, Entity p_346210_, Vec3 p_345413_) com.mojang.serialization.MapCodec
<RunFunction> codec()
final boolean
Indicates whether some other object is "equal to" this one.function()
Returns the value of thefunction
record component.final int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.world.item.enchantment.effects.EnchantmentEntityEffect
onChangedBlock
Methods inherited from interface net.minecraft.world.item.enchantment.effects.EnchantmentLocationBasedEffect
onDeactivated
-
Field Details
-
function
The field for thefunction
record component. -
LOGGER
private static final org.slf4j.Logger LOGGER -
CODEC
-
-
Constructor Details
-
RunFunction
Creates an instance of aRunFunction
record class.- Parameters:
function
- the value for thefunction
record component
-
-
Method Details
-
apply
public void apply(ServerLevel p_346152_, int p_344788_, EnchantedItemInUse p_344801_, Entity p_346210_, Vec3 p_345413_) - Specified by:
apply
in interfaceEnchantmentEntityEffect
-
codec
- Specified by:
codec
in interfaceEnchantmentEntityEffect
- Specified by:
codec
in interfaceEnchantmentLocationBasedEffect
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
function
Returns the value of thefunction
record component.- Returns:
- the value of the
function
record component
-