Record Class EntityFlagsPredicate

java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.EntityFlagsPredicate

public record EntityFlagsPredicate(Optional<Boolean> isOnFire, Optional<Boolean> isCrouching, Optional<Boolean> isSprinting, Optional<Boolean> isSwimming, Optional<Boolean> isBaby) extends Record
  • Field Details

    • isOnFire

      private final Optional<Boolean> isOnFire
      The field for the isOnFire record component.
    • isCrouching

      private final Optional<Boolean> isCrouching
      The field for the isCrouching record component.
    • isSprinting

      private final Optional<Boolean> isSprinting
      The field for the isSprinting record component.
    • isSwimming

      private final Optional<Boolean> isSwimming
      The field for the isSwimming record component.
    • isBaby

      private final Optional<Boolean> isBaby
      The field for the isBaby record component.
    • CODEC

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

    • EntityFlagsPredicate

      public EntityFlagsPredicate(Optional<Boolean> isOnFire, Optional<Boolean> isCrouching, Optional<Boolean> isSprinting, Optional<Boolean> isSwimming, Optional<Boolean> isBaby)
      Creates an instance of a EntityFlagsPredicate record class.
      Parameters:
      isOnFire - the value for the isOnFire record component
      isCrouching - the value for the isCrouching record component
      isSprinting - the value for the isSprinting record component
      isSwimming - the value for the isSwimming record component
      isBaby - the value for the isBaby record component
  • Method Details

    • matches

      public boolean matches(Entity p_33697_)
    • 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.
    • isOnFire

      public Optional<Boolean> isOnFire()
      Returns the value of the isOnFire record component.
      Returns:
      the value of the isOnFire record component
    • isCrouching

      public Optional<Boolean> isCrouching()
      Returns the value of the isCrouching record component.
      Returns:
      the value of the isCrouching record component
    • isSprinting

      public Optional<Boolean> isSprinting()
      Returns the value of the isSprinting record component.
      Returns:
      the value of the isSprinting record component
    • isSwimming

      public Optional<Boolean> isSwimming()
      Returns the value of the isSwimming record component.
      Returns:
      the value of the isSwimming record component
    • isBaby

      public Optional<Boolean> isBaby()
      Returns the value of the isBaby record component.
      Returns:
      the value of the isBaby record component