Record Class WhenCondition

java.lang.Object
java.lang.Record
cromveil.combatnumbers.styles.WhenCondition

public record WhenCondition(@Nullable net.minecraft.resources.Identifier type, List<net.minecraft.resources.Identifier> tags, List<net.minecraft.resources.Identifier> flags, @Nullable net.minecraft.advancements.predicates.entity.EntityPredicate attacker, @Nullable net.minecraft.advancements.predicates.entity.EntityPredicate target, @Nullable net.minecraft.advancements.predicates.ItemPredicate weapon) extends Record
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<WhenCondition>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    WhenCondition(@Nullable net.minecraft.resources.Identifier type, List<net.minecraft.resources.Identifier> tags, List<net.minecraft.resources.Identifier> flags, @Nullable net.minecraft.advancements.predicates.entity.EntityPredicate attacker, @Nullable net.minecraft.advancements.predicates.entity.EntityPredicate target, @Nullable net.minecraft.advancements.predicates.ItemPredicate weapon)
    Creates an instance of a WhenCondition record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable net.minecraft.advancements.predicates.entity.EntityPredicate
    Returns the value of the attacker record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    List<net.minecraft.resources.Identifier>
    Returns the value of the flags record component.
    final int
    Returns a hash code value for this object.
    boolean
     
    int
     
    List<net.minecraft.resources.Identifier>
    Returns the value of the tags record component.
    @Nullable net.minecraft.advancements.predicates.entity.EntityPredicate
    Returns the value of the target record component.
    final String
    Returns a string representation of this record class.
    @Nullable net.minecraft.resources.Identifier
    Returns the value of the type record component.
    @Nullable net.minecraft.advancements.predicates.ItemPredicate
    Returns the value of the weapon record component.

    Methods inherited from class Object

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

    • CODEC

      public static final com.mojang.serialization.Codec<WhenCondition> CODEC
  • Constructor Details

    • WhenCondition

      public WhenCondition(@Nullable net.minecraft.resources.Identifier type, List<net.minecraft.resources.Identifier> tags, List<net.minecraft.resources.Identifier> flags, @Nullable net.minecraft.advancements.predicates.entity.EntityPredicate attacker, @Nullable net.minecraft.advancements.predicates.entity.EntityPredicate target, @Nullable net.minecraft.advancements.predicates.ItemPredicate weapon)
      Creates an instance of a WhenCondition record class.
      Parameters:
      type - the value for the type record component
      tags - the value for the tags record component
      flags - the value for the flags record component
      attacker - the value for the attacker record component
      target - the value for the target record component
      weapon - the value for the weapon record component
  • Method Details

    • matches

      public boolean matches(CombatEvent event)
    • specificity

      public int specificity()
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • type

      public @Nullable net.minecraft.resources.Identifier type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • tags

      public List<net.minecraft.resources.Identifier> tags()
      Returns the value of the tags record component.
      Returns:
      the value of the tags record component
    • flags

      public List<net.minecraft.resources.Identifier> flags()
      Returns the value of the flags record component.
      Returns:
      the value of the flags record component
    • attacker

      public @Nullable net.minecraft.advancements.predicates.entity.EntityPredicate attacker()
      Returns the value of the attacker record component.
      Returns:
      the value of the attacker record component
    • target

      public @Nullable net.minecraft.advancements.predicates.entity.EntityPredicate target()
      Returns the value of the target record component.
      Returns:
      the value of the target record component
    • weapon

      public @Nullable net.minecraft.advancements.predicates.ItemPredicate weapon()
      Returns the value of the weapon record component.
      Returns:
      the value of the weapon record component