Package net.minecraft.advancements
Record Class AdvancementRewards
java.lang.Object
java.lang.Record
net.minecraft.advancements.AdvancementRewards
public record AdvancementRewards(int experience, List<ResourceLocation> loot, List<ResourceLocation> recipes, Optional<CacheableFunction> function)
extends Record
- 
Nested Class SummaryNested Classes
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<AdvancementRewards>static final AdvancementRewardsprivate final intThe field for theexperiencerecord component.private final Optional<CacheableFunction>The field for thefunctionrecord component.private final List<ResourceLocation>The field for thelootrecord component.private final List<ResourceLocation>The field for therecipesrecord component.
- 
Constructor SummaryConstructorsConstructorDescriptionAdvancementRewards(int experience, List<ResourceLocation> loot, List<ResourceLocation> recipes, Optional<CacheableFunction> function) Creates an instance of aAdvancementRewardsrecord class.
- 
Method SummaryModifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.intReturns the value of theexperiencerecord component.function()Returns the value of thefunctionrecord component.voidgrant(ServerPlayer p_9990_) final inthashCode()Returns a hash code value for this object.loot()Returns the value of thelootrecord component.recipes()Returns the value of therecipesrecord component.final StringtoString()Returns a string representation of this record class.
- 
Field Details- 
experienceprivate final int experienceThe field for theexperiencerecord component.
- 
lootThe field for thelootrecord component.
- 
recipesThe field for therecipesrecord component.
- 
functionThe field for thefunctionrecord component.
- 
CODEC
- 
EMPTY
 
- 
- 
Constructor Details- 
AdvancementRewardspublic AdvancementRewards(int experience, List<ResourceLocation> loot, List<ResourceLocation> recipes, Optional<CacheableFunction> function) Creates an instance of aAdvancementRewardsrecord class.- Parameters:
- experience- the value for the- experiencerecord component
- loot- the value for the- lootrecord component
- recipes- the value for the- recipesrecord component
- function- the value for the- functionrecord component
 
 
- 
- 
Method Details- 
grant
- 
toStringReturns 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.
- 
hashCodepublic 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.
- 
equalsIndicates 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='.
- 
experiencepublic int experience()Returns the value of theexperiencerecord component.- Returns:
- the value of the experiencerecord component
 
- 
lootReturns the value of thelootrecord component.- Returns:
- the value of the lootrecord component
 
- 
recipesReturns the value of therecipesrecord component.- Returns:
- the value of the recipesrecord component
 
- 
functionReturns the value of thefunctionrecord component.- Returns:
- the value of the functionrecord component
 
 
-