Record Class ContextLootScoreProvider

java.lang.Object
java.lang.Record
net.minecraft.loot.provider.score.ContextLootScoreProvider
Record Components:
target -
All Implemented Interfaces:
LootScoreProvider

public record ContextLootScoreProvider(LootContext.EntityTarget target) extends Record implements LootScoreProvider
Mappings:
Namespace Name
official egp
intermediary net/minecraft/class_5664
named net/minecraft/loot/provider/score/ContextLootScoreProvider
official c
intermediary comp_1902
named target
  • Field Details

    • target

      private final LootContext.EntityTarget target
      The field for the target record component.
    • CODEC

      public static final com.mojang.serialization.Codec<ContextLootScoreProvider> CODEC
      Mappings:
      Namespace Name Mixin selector
      official a Legp;a:Lcom/mojang/serialization/Codec;
      intermediary field_45892 Lnet/minecraft/class_5664;field_45892:Lcom/mojang/serialization/Codec;
      named CODEC Lnet/minecraft/loot/provider/score/ContextLootScoreProvider;CODEC:Lcom/mojang/serialization/Codec;
    • field_45893

      public static final com.mojang.serialization.Codec<ContextLootScoreProvider> field_45893
      Mappings:
      Namespace Name Mixin selector
      official b Legp;b:Lcom/mojang/serialization/Codec;
      intermediary field_45893 Lnet/minecraft/class_5664;field_45893:Lcom/mojang/serialization/Codec;
      named field_45893 Lnet/minecraft/loot/provider/score/ContextLootScoreProvider;field_45893:Lcom/mojang/serialization/Codec;
  • Constructor Details

    • ContextLootScoreProvider

      public ContextLootScoreProvider(LootContext.EntityTarget target)
      Creates an instance of a ContextLootScoreProvider record class.
      Parameters:
      target - the value for the target record component
  • Method Details

    • create

      public static LootScoreProvider create(LootContext.EntityTarget target)
      Mappings:
      Namespace Name Mixin selector
      official a Legp;a(Lecq$b;)Legs;
      intermediary method_35571 Lnet/minecraft/class_5664;method_35571(Lnet/minecraft/class_47$class_50;)Lnet/minecraft/class_5670;
      named create Lnet/minecraft/loot/provider/score/ContextLootScoreProvider;create(Lnet/minecraft/loot/context/LootContext$EntityTarget;)Lnet/minecraft/loot/provider/score/LootScoreProvider;
    • getType

      public LootScoreProviderType getType()
      Specified by:
      getType in interface LootScoreProvider
      Mappings:
      Namespace Name Mixin selector
      official a Legs;a()Legr;
      intermediary method_32475 Lnet/minecraft/class_5670;method_32475()Lnet/minecraft/class_5669;
      named getType Lnet/minecraft/loot/provider/score/LootScoreProvider;getType()Lnet/minecraft/loot/provider/score/LootScoreProviderType;
    • getName

      @Nullable public @Nullable String getName(LootContext context)
      Specified by:
      getName in interface LootScoreProvider
      Mappings:
      Namespace Name Mixin selector
      official a Legs;a(Lecq;)Ljava/lang/String;
      intermediary method_32476 Lnet/minecraft/class_5670;method_32476(Lnet/minecraft/class_47;)Ljava/lang/String;
      named getName Lnet/minecraft/loot/provider/score/LootScoreProvider;getName(Lnet/minecraft/loot/context/LootContext;)Ljava/lang/String;
    • getRequiredParameters

      public Set<LootContextParameter<?>> getRequiredParameters()
      Specified by:
      getRequiredParameters in interface LootScoreProvider
      Mappings:
      Namespace Name Mixin selector
      official b Legs;b()Ljava/util/Set;
      intermediary method_32477 Lnet/minecraft/class_5670;method_32477()Ljava/util/Set;
      named getRequiredParameters Lnet/minecraft/loot/provider/score/LootScoreProvider;getRequiredParameters()Ljava/util/Set;
    • 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.
    • target

      public LootContext.EntityTarget target()
      Returns the value of the target record component.
      Returns:
      the value of the target record component