Record Class MultiJumpEffect
java.lang.Object
java.lang.Record
johnsmith.enchantmentcore.api.enchantment.effect.MultiJumpEffect
- Record Components:
jumps- TheEnchantmentValueEffectcalculating the maximum number of mid-air jumps allowed.allowElytra- Whether mid-air jumps can be executed while actively gliding with an Elytra.
public record MultiJumpEffect(net.minecraft.world.item.enchantment.effects.EnchantmentValueEffect jumps, boolean allowElytra)
extends Record
Data-driven enchantment effect component that grants additional mid-air jumps to a
LivingEntity before touching the ground.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringJSON field key for permitting multi-jumps during Elytra flight.static final com.mojang.serialization.Codec<MultiJumpEffect> Codec for serializing and deserializingMultiJumpEffectinstances from JSON.static final StringJSON field key for the mid-air jump count value effect.static final StringRegistry path identifier for this effect component.static final LevelBasedKeyProviderSupplies the JSON property keys holding level-based value definitions for data transformation. -
Constructor Summary
ConstructorsConstructorDescriptionMultiJumpEffect(net.minecraft.world.item.enchantment.effects.EnchantmentValueEffect jumps, boolean allowElytra) Creates an instance of aMultiJumpEffectrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of theallowElytrarecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.net.minecraft.world.item.enchantment.effects.EnchantmentValueEffectjumps()Returns the value of thejumpsrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
JUMPS
-
ALLOW_ELYTRA
JSON field key for permitting multi-jumps during Elytra flight.- See Also:
-
KEY
-
KEY_PROVIDER
Supplies the JSON property keys holding level-based value definitions for data transformation. -
CODEC
Codec for serializing and deserializingMultiJumpEffectinstances from JSON.
-
-
Constructor Details
-
MultiJumpEffect
public MultiJumpEffect(net.minecraft.world.item.enchantment.effects.EnchantmentValueEffect jumps, boolean allowElytra) Creates an instance of aMultiJumpEffectrecord class.- Parameters:
jumps- the value for thejumpsrecord componentallowElytra- the value for theallowElytrarecord component
-
-
Method Details
-
toString
-
hashCode
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
jumps
-
allowElytra
public boolean allowElytra()Returns the value of theallowElytrarecord component.- Returns:
- the value of the
allowElytrarecord component
-