Record Class BackgroundMusic
java.lang.Object
java.lang.Record
net.minecraft.world.attribute.BackgroundMusic
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<BackgroundMusic> The field for thecreativeMusicrecord component.The field for thedefaultMusicrecord component.static final BackgroundMusicstatic final BackgroundMusicThe field for theunderwaterMusicrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionBackgroundMusic(Optional<Music> defaultMusic, Optional<Music> creativeMusic, Optional<Music> underwaterMusic) Creates an instance of aBackgroundMusicrecord class.BackgroundMusic(Holder<SoundEvent> sound) BackgroundMusic(Music music) -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecreativeMusicrecord component.Returns the value of thedefaultMusicrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.select(boolean isCreative, boolean isUnderwater) final StringtoString()Returns a string representation of this record class.Returns the value of theunderwaterMusicrecord component.withUnderwater(Music underwaterMusic)
-
Field Details
-
defaultMusic
-
creativeMusic
-
underwaterMusic
-
EMPTY
-
OVERWORLD
-
CODEC
-
-
Constructor Details
-
BackgroundMusic
-
BackgroundMusic
-
BackgroundMusic
public BackgroundMusic(Optional<Music> defaultMusic, Optional<Music> creativeMusic, Optional<Music> underwaterMusic) Creates an instance of aBackgroundMusicrecord class.- Parameters:
defaultMusic- the value for thedefaultMusicrecord componentcreativeMusic- the value for thecreativeMusicrecord componentunderwaterMusic- the value for theunderwaterMusicrecord component
-
-
Method Details
-
withUnderwater
-
select
-
toString
-
hashCode
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
defaultMusic
-
creativeMusic
-
underwaterMusic
-