Package net.minecraft.world.attribute
Record Class AmbientAdditionsSettings
java.lang.Object
java.lang.Record
net.minecraft.world.attribute.AmbientAdditionsSettings
public record AmbientAdditionsSettings(Holder<SoundEvent> soundEvent, double tickChance)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<AmbientAdditionsSettings> private final Holder<SoundEvent> The field for thesoundEventrecord component.private final doubleThe field for thetickChancerecord component. -
Constructor Summary
ConstructorsConstructorDescriptionAmbientAdditionsSettings(Holder<SoundEvent> soundEvent, double tickChance) Creates an instance of aAmbientAdditionsSettingsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thesoundEventrecord component.doubleReturns the value of thetickChancerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
soundEvent
The field for thesoundEventrecord component. -
tickChance
private final double tickChanceThe field for thetickChancerecord component. -
CODEC
-
-
Constructor Details
-
AmbientAdditionsSettings
Creates an instance of aAmbientAdditionsSettingsrecord class.- Parameters:
soundEvent- the value for thesoundEventrecord componenttickChance- the value for thetickChancerecord component
-
-
Method Details
-
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. -
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. -
equals
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
soundEvent
Returns the value of thesoundEventrecord component.- Returns:
- the value of the
soundEventrecord component
-
tickChance
public double tickChance()Returns the value of thetickChancerecord component.- Returns:
- the value of the
tickChancerecord component
-