Record Class CowSoundVariant
java.lang.Object
java.lang.Record
net.minecraft.world.entity.animal.cow.CowSoundVariant
public record CowSoundVariant(Holder<SoundEvent> ambientSound, Holder<SoundEvent> hurtSound, Holder<SoundEvent> deathSound, Holder<SoundEvent> stepSound)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Holder<SoundEvent> The field for theambientSoundrecord component.static final com.mojang.serialization.Codec<Holder<CowSoundVariant>> private final Holder<SoundEvent> The field for thedeathSoundrecord component.static final com.mojang.serialization.Codec<CowSoundVariant> private final Holder<SoundEvent> The field for thehurtSoundrecord component.static final com.mojang.serialization.Codec<CowSoundVariant> private final Holder<SoundEvent> The field for thestepSoundrecord component.static final StreamCodec<RegistryFriendlyByteBuf, Holder<CowSoundVariant>> -
Constructor Summary
ConstructorsConstructorDescriptionCowSoundVariant(Holder<SoundEvent> ambientSound, Holder<SoundEvent> hurtSound, Holder<SoundEvent> deathSound, Holder<SoundEvent> stepSound) Creates an instance of aCowSoundVariantrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theambientSoundrecord component.private static com.mojang.serialization.Codec<CowSoundVariant> codec()Returns the value of thedeathSoundrecord 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 thehurtSoundrecord component.Returns the value of thestepSoundrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
ambientSound
The field for theambientSoundrecord component. -
hurtSound
The field for thehurtSoundrecord component. -
deathSound
The field for thedeathSoundrecord component. -
stepSound
The field for thestepSoundrecord component. -
DIRECT_CODEC
-
NETWORK_CODEC
-
CODEC
-
STREAM_CODEC
-
-
Constructor Details
-
CowSoundVariant
public CowSoundVariant(Holder<SoundEvent> ambientSound, Holder<SoundEvent> hurtSound, Holder<SoundEvent> deathSound, Holder<SoundEvent> stepSound) Creates an instance of aCowSoundVariantrecord class.- Parameters:
ambientSound- the value for theambientSoundrecord componenthurtSound- the value for thehurtSoundrecord componentdeathSound- the value for thedeathSoundrecord componentstepSound- the value for thestepSoundrecord component
-
-
Method Details
-
codec
-
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). -
ambientSound
Returns the value of theambientSoundrecord component.- Returns:
- the value of the
ambientSoundrecord component
-
hurtSound
Returns the value of thehurtSoundrecord component.- Returns:
- the value of the
hurtSoundrecord component
-
deathSound
Returns the value of thedeathSoundrecord component.- Returns:
- the value of the
deathSoundrecord component
-
stepSound
Returns the value of thestepSoundrecord component.- Returns:
- the value of the
stepSoundrecord component
-