Record Class NbtPredicate

java.lang.Object
java.lang.Record
net.minecraft.predicate.NbtPredicate
Record Components:
nbt -

public record NbtPredicate(NbtCompound nbt) extends Record
Mappings:
Namespace Name
official cm
intermediary net/minecraft/class_2105
named net/minecraft/predicate/NbtPredicate
official b
intermediary comp_1816
named nbt
  • Field Details

    • nbt

      private final NbtCompound nbt
      The field for the nbt record component.
    • CODEC

      public static final com.mojang.serialization.Codec<NbtPredicate> CODEC
      Mappings:
      Namespace Name Mixin selector
      official a Lcm;a:Lcom/mojang/serialization/Codec;
      intermediary field_45768 Lnet/minecraft/class_2105;field_45768:Lcom/mojang/serialization/Codec;
      named CODEC Lnet/minecraft/predicate/NbtPredicate;CODEC:Lcom/mojang/serialization/Codec;
  • Constructor Details

    • NbtPredicate

      public NbtPredicate(NbtCompound nbt)
      Creates an instance of a NbtPredicate record class.
      Parameters:
      nbt - the value for the nbt record component
  • Method Details

    • test

      public boolean test(ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      official a Lcm;a(Lcmy;)Z
      intermediary method_9074 Lnet/minecraft/class_2105;method_9074(Lnet/minecraft/class_1799;)Z
      named test Lnet/minecraft/predicate/NbtPredicate;test(Lnet/minecraft/item/ItemStack;)Z
    • test

      public boolean test(Entity entity)
      Mappings:
      Namespace Name Mixin selector
      official a Lcm;a(Lblv;)Z
      intermediary method_9072 Lnet/minecraft/class_2105;method_9072(Lnet/minecraft/class_1297;)Z
      named test Lnet/minecraft/predicate/NbtPredicate;test(Lnet/minecraft/entity/Entity;)Z
    • test

      public boolean test(@Nullable @Nullable NbtElement element)
      Mappings:
      Namespace Name Mixin selector
      official a Lcm;a(Ltk;)Z
      intermediary method_9077 Lnet/minecraft/class_2105;method_9077(Lnet/minecraft/class_2520;)Z
      named test Lnet/minecraft/predicate/NbtPredicate;test(Lnet/minecraft/nbt/NbtElement;)Z
    • entityToNbt

      public static NbtCompound entityToNbt(Entity entity)
      Mappings:
      Namespace Name Mixin selector
      official b Lcm;b(Lblv;)Lsn;
      intermediary method_9076 Lnet/minecraft/class_2105;method_9076(Lnet/minecraft/class_1297;)Lnet/minecraft/class_2487;
      named entityToNbt Lnet/minecraft/predicate/NbtPredicate;entityToNbt(Lnet/minecraft/entity/Entity;)Lnet/minecraft/nbt/NbtCompound;
    • 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.
    • nbt

      public NbtCompound nbt()
      Returns the value of the nbt record component.
      Returns:
      the value of the nbt record component