Record Class MultiJumpEffect

java.lang.Object
java.lang.Record
johnsmith.enchantmentcore.api.enchantment.effect.MultiJumpEffect
Record Components:
jumps - The EnchantmentValueEffect calculating 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

    Fields
    Modifier and Type
    Field
    Description
    static final String
    JSON field key for permitting multi-jumps during Elytra flight.
    static final com.mojang.serialization.Codec<MultiJumpEffect>
    Codec for serializing and deserializing MultiJumpEffect instances from JSON.
    static final String
    JSON field key for the mid-air jump count value effect.
    static final String
    Registry path identifier for this effect component.
    Supplies the JSON property keys holding level-based value definitions for data transformation.
  • Constructor Summary

    Constructors
    Constructor
    Description
    MultiJumpEffect(net.minecraft.world.item.enchantment.effects.EnchantmentValueEffect jumps, boolean allowElytra)
    Creates an instance of a MultiJumpEffect record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns the value of the allowElytra record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    net.minecraft.world.item.enchantment.effects.EnchantmentValueEffect
    Returns the value of the jumps record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • JUMPS

      public static final String JUMPS
      JSON field key for the mid-air jump count value effect.
      See Also:
    • ALLOW_ELYTRA

      public static final String ALLOW_ELYTRA
      JSON field key for permitting multi-jumps during Elytra flight.
      See Also:
    • KEY

      public static final String KEY
      Registry path identifier for this effect component.
      See Also:
    • KEY_PROVIDER

      public static final LevelBasedKeyProvider KEY_PROVIDER
      Supplies the JSON property keys holding level-based value definitions for data transformation.
    • CODEC

      public static final com.mojang.serialization.Codec<MultiJumpEffect> CODEC
      Codec for serializing and deserializing MultiJumpEffect instances from JSON.
  • Constructor Details

    • MultiJumpEffect

      public MultiJumpEffect(net.minecraft.world.item.enchantment.effects.EnchantmentValueEffect jumps, boolean allowElytra)
      Creates an instance of a MultiJumpEffect record class.
      Parameters:
      jumps - the value for the jumps record component
      allowElytra - the value for the allowElytra record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • jumps

      public net.minecraft.world.item.enchantment.effects.EnchantmentValueEffect jumps()
      Returns the value of the jumps record component.
      Returns:
      the value of the jumps record component
    • allowElytra

      public boolean allowElytra()
      Returns the value of the allowElytra record component.
      Returns:
      the value of the allowElytra record component