Package net.minecraft.world.attribute
Record Class AmbientMoodSettings
java.lang.Object
java.lang.Record
net.minecraft.world.attribute.AmbientMoodSettings
public record AmbientMoodSettings(Holder<SoundEvent> soundEvent, int tickDelay, int blockSearchExtent, double soundPositionOffset)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intThe field for theblockSearchExtentrecord component.static final com.mojang.serialization.Codec<AmbientMoodSettings> static final AmbientMoodSettingsprivate final Holder<SoundEvent> The field for thesoundEventrecord component.private final doubleThe field for thesoundPositionOffsetrecord component.private final intThe field for thetickDelayrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionAmbientMoodSettings(Holder<SoundEvent> soundEvent, int tickDelay, int blockSearchExtent, double soundPositionOffset) Creates an instance of aAmbientMoodSettingsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theblockSearchExtentrecord component.final 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 thesoundPositionOffsetrecord component.intReturns the value of thetickDelayrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
soundEvent
The field for thesoundEventrecord component. -
tickDelay
private final int tickDelayThe field for thetickDelayrecord component. -
blockSearchExtent
private final int blockSearchExtentThe field for theblockSearchExtentrecord component. -
soundPositionOffset
private final double soundPositionOffsetThe field for thesoundPositionOffsetrecord component. -
CODEC
-
LEGACY_CAVE_SETTINGS
-
-
Constructor Details
-
AmbientMoodSettings
public AmbientMoodSettings(Holder<SoundEvent> soundEvent, int tickDelay, int blockSearchExtent, double soundPositionOffset) Creates an instance of aAmbientMoodSettingsrecord class.- Parameters:
soundEvent- the value for thesoundEventrecord componenttickDelay- the value for thetickDelayrecord componentblockSearchExtent- the value for theblockSearchExtentrecord componentsoundPositionOffset- the value for thesoundPositionOffsetrecord 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
-
tickDelay
public int tickDelay()Returns the value of thetickDelayrecord component.- Returns:
- the value of the
tickDelayrecord component
-
blockSearchExtent
public int blockSearchExtent()Returns the value of theblockSearchExtentrecord component.- Returns:
- the value of the
blockSearchExtentrecord component
-
soundPositionOffset
public double soundPositionOffset()Returns the value of thesoundPositionOffsetrecord component.- Returns:
- the value of the
soundPositionOffsetrecord component
-