Record Class ConstantValue
java.lang.Object
java.lang.Record
net.minecraft.world.level.storage.loot.providers.number.ConstantValue
- All Implemented Interfaces:
- LootContextUser,- NumberProvider
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<ConstantValue>static final com.mojang.serialization.Codec<ConstantValue>private final floatThe field for thevaluerecord component.
- 
Constructor SummaryConstructorsConstructorDescriptionConstantValue(float value) Creates an instance of aConstantValuerecord class.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanIndicates whether some other object is "equal to" this one.static ConstantValueexactly(float p_165693_) floatgetFloat(LootContext p_165695_) getType()inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.floatvalue()Returns the value of thevaluerecord component.Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.world.level.storage.loot.LootContextUsergetReferencedContextParams, validateMethods inherited from interface net.minecraft.world.level.storage.loot.providers.number.NumberProvidergetInt
- 
Field Details- 
valueprivate final float valueThe field for thevaluerecord component.
- 
CODEC
- 
INLINE_CODEC
 
- 
- 
Constructor Details- 
ConstantValuepublic ConstantValue(float value) Creates an instance of aConstantValuerecord class.- Parameters:
- value- the value for the- valuerecord component
 
 
- 
- 
Method Details- 
getType- Specified by:
- getTypein interface- NumberProvider
 
- 
getFloat- Specified by:
- getFloatin interface- NumberProvider
 
- 
exactly
- 
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. All components in this record class are compared with '=='.
- 
hashCodepublic int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
- 
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.
- 
valuepublic float value()Returns the value of thevaluerecord component.- Returns:
- the value of the valuerecord component
 
 
-