Package net.minecraft.world.level.biome
Record Class MobSpawnSettings.MobSpawnCost
java.lang.Object
java.lang.Record
net.minecraft.world.level.biome.MobSpawnSettings.MobSpawnCost
- Enclosing class:
- MobSpawnSettings
public static record MobSpawnSettings.MobSpawnCost(double energyBudget, double charge)
extends Record
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final doubleThe field for thechargerecord component.static final com.mojang.serialization.Codec<MobSpawnSettings.MobSpawnCost>private final doubleThe field for theenergyBudgetrecord component.
- 
Constructor SummaryConstructorsConstructorDescriptionMobSpawnCost(double energyBudget, double charge) Creates an instance of aMobSpawnCostrecord class.
- 
Method SummaryModifier and TypeMethodDescriptiondoublecharge()Returns the value of thechargerecord component.doubleReturns the value of theenergyBudgetrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
- 
Field Details- 
energyBudgetprivate final double energyBudgetThe field for theenergyBudgetrecord component.
- 
chargeprivate final double chargeThe field for thechargerecord component.
- 
CODEC
 
- 
- 
Constructor Details- 
MobSpawnCostpublic MobSpawnCost(double energyBudget, double charge) Creates an instance of aMobSpawnCostrecord class.- Parameters:
- energyBudget- the value for the- energyBudgetrecord component
- charge- the value for the- chargerecord component
 
 
- 
- 
Method Details- 
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. All components in this record class are compared with '=='.
- 
energyBudgetpublic double energyBudget()Returns the value of theenergyBudgetrecord component.- Returns:
- the value of the energyBudgetrecord component
 
- 
chargepublic double charge()Returns the value of thechargerecord component.- Returns:
- the value of the chargerecord component
 
 
-