Class LootContextPredicate

java.lang.Object
net.minecraft.predicate.entity.LootContextPredicate

public class LootContextPredicate extends Object
A list of loot conditions applied to entities. All conditions must match for this unified conditions to match. Mainly used by advancements.
Mappings:
Namespace Name
official bc
intermediary net/minecraft/class_5258
named net/minecraft/predicate/entity/LootContextPredicate
  • Field Details

    • conditions

      private final List<LootCondition> conditions
      Mappings:
      Namespace Name Mixin selector
      official a Lbc;a:Ljava/util/List;
      intermediary field_24389 Lnet/minecraft/class_5258;field_24389:Ljava/util/List;
      named conditions Lnet/minecraft/predicate/entity/LootContextPredicate;conditions:Ljava/util/List;
    • combinedCondition

      private final Predicate<LootContext> combinedCondition
      Mappings:
      Namespace Name Mixin selector
      official b Lbc;b:Ljava/util/function/Predicate;
      intermediary field_24390 Lnet/minecraft/class_5258;field_24390:Ljava/util/function/Predicate;
      named combinedCondition Lnet/minecraft/predicate/entity/LootContextPredicate;combinedCondition:Ljava/util/function/Predicate;
  • Constructor Details

    • LootContextPredicate

      LootContextPredicate(List<LootCondition> conditions)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lbc;<init>(Ljava/util/List;)V
      intermediary <init> Lnet/minecraft/class_5258;<init>(Ljava/util/List;)V
      named <init> Lnet/minecraft/predicate/entity/LootContextPredicate;<init>(Ljava/util/List;)V
  • Method Details

    • create

      public static LootContextPredicate create(LootCondition[] conditions)
      Mappings:
      Namespace Name Mixin selector
      official a Lbc;a([Lefp;)Lbc;
      intermediary method_27973 Lnet/minecraft/class_5258;method_27973([Lnet/minecraft/class_5341;)Lnet/minecraft/class_5258;
      named create Lnet/minecraft/predicate/entity/LootContextPredicate;create([Lnet/minecraft/loot/condition/LootCondition;)Lnet/minecraft/predicate/entity/LootContextPredicate;
    • fromJson

      public static Optional<Optional<LootContextPredicate>> fromJson(String key, AdvancementEntityPredicateDeserializer predicateDeserializer, @Nullable @Nullable JsonElement json, LootContextType contextType)
      Mappings:
      Namespace Name Mixin selector
      official a Lbc;a(Ljava/lang/String;Lbg;Lcom/google/gson/JsonElement;Leez;)Ljava/util/Optional;
      intermediary method_27807 Lnet/minecraft/class_5258;method_27807(Ljava/lang/String;Lnet/minecraft/class_5257;Lcom/google/gson/JsonElement;Lnet/minecraft/class_176;)Ljava/util/Optional;
      named fromJson Lnet/minecraft/predicate/entity/LootContextPredicate;fromJson(Ljava/lang/String;Lnet/minecraft/predicate/entity/AdvancementEntityPredicateDeserializer;Lcom/google/gson/JsonElement;Lnet/minecraft/loot/context/LootContextType;)Ljava/util/Optional;
    • test

      public boolean test(LootContext context)
      Mappings:
      Namespace Name Mixin selector
      official a Lbc;a(Lecq;)Z
      intermediary method_27806 Lnet/minecraft/class_5258;method_27806(Lnet/minecraft/class_47;)Z
      named test Lnet/minecraft/predicate/entity/LootContextPredicate;test(Lnet/minecraft/loot/context/LootContext;)Z
    • toJson

      public JsonElement toJson()
      Mappings:
      Namespace Name Mixin selector
      official a Lbc;a()Lcom/google/gson/JsonElement;
      intermediary method_27804 Lnet/minecraft/class_5258;method_27804()Lcom/google/gson/JsonElement;
      named toJson Lnet/minecraft/predicate/entity/LootContextPredicate;toJson()Lcom/google/gson/JsonElement;
    • toPredicatesJsonArray

      public static JsonElement toPredicatesJsonArray(List<LootContextPredicate> list)
      Mappings:
      Namespace Name Mixin selector
      official a Lbc;a(Ljava/util/List;)Lcom/google/gson/JsonElement;
      intermediary method_27808 Lnet/minecraft/class_5258;method_27808(Ljava/util/List;)Lcom/google/gson/JsonElement;
      named toPredicatesJsonArray Lnet/minecraft/predicate/entity/LootContextPredicate;toPredicatesJsonArray(Ljava/util/List;)Lcom/google/gson/JsonElement;