Record Class EnchantmentEffectEntry<T>

java.lang.Object
java.lang.Record
net.minecraft.enchantment.effect.EnchantmentEffectEntry<T>
Record Components:
effect -
requirements -

public record EnchantmentEffectEntry<T>(T effect, Optional<LootCondition> requirements) extends Record
Mappings:
Namespace Name
named net/minecraft/enchantment/effect/EnchantmentEffectEntry
intermediary net/minecraft/class_9698
official daa
named effect
intermediary comp_2680
official a
named requirements
intermediary comp_2681
official b
  • Field Details

  • Constructor Details

  • Method Details

    • createRequirementsCodec

      public static com.mojang.serialization.Codec<LootCondition> createRequirementsCodec(LootContextType lootContextType)
      Mappings:
      Namespace Name Mixin selector
      named createRequirementsCodec Lnet/minecraft/enchantment/effect/EnchantmentEffectEntry;createRequirementsCodec(Lnet/minecraft/loot/context/LootContextType;)Lcom/mojang/serialization/Codec;
      intermediary method_60007 Lnet/minecraft/class_9698;method_60007(Lnet/minecraft/class_176;)Lcom/mojang/serialization/Codec;
      official a Ldaa;a(Leul;)Lcom/mojang/serialization/Codec;
    • createCodec

      public static <T> com.mojang.serialization.Codec<EnchantmentEffectEntry<T>> createCodec(com.mojang.serialization.Codec<T> effectCodec, LootContextType lootContextType)
      Mappings:
      Namespace Name Mixin selector
      named createCodec Lnet/minecraft/enchantment/effect/EnchantmentEffectEntry;createCodec(Lcom/mojang/serialization/Codec;Lnet/minecraft/loot/context/LootContextType;)Lcom/mojang/serialization/Codec;
      intermediary method_60004 Lnet/minecraft/class_9698;method_60004(Lcom/mojang/serialization/Codec;Lnet/minecraft/class_176;)Lcom/mojang/serialization/Codec;
      official a Ldaa;a(Lcom/mojang/serialization/Codec;Leul;)Lcom/mojang/serialization/Codec;
    • test

      public boolean test(LootContext context)
      Mappings:
      Namespace Name Mixin selector
      named test Lnet/minecraft/enchantment/effect/EnchantmentEffectEntry;test(Lnet/minecraft/loot/context/LootContext;)Z
      intermediary method_60006 Lnet/minecraft/class_9698;method_60006(Lnet/minecraft/class_47;)Z
      official a Ldaa;a(Lerr;)Z
    • 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 object)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      object - the object with which to compare
      Returns:
      true if this object is the same as the object argument; false otherwise.
    • effect

      public T effect()
      Returns the value of the effect record component.
      Returns:
      the value of the effect record component
    • requirements

      public Optional<LootCondition> requirements()
      Returns the value of the requirements record component.
      Returns:
      the value of the requirements record component