Package net.minecraft.item
Record Class Instrument
java.lang.Object
java.lang.Record
net.minecraft.item.Instrument
- Record Components:
soundEvent-useDuration-range-
public record Instrument(RegistryEntry<SoundEvent> soundEvent, int useDuration, float range)
extends Record
- Mappings:
Namespace Name official cfpintermediary net/minecraft/class_7444named net/minecraft/item/Instrumentofficial bintermediary comp_772named soundEventofficial cintermediary comp_773named useDurationofficial dintermediary comp_774named range
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<Instrument>private final floatThe field for therangerecord component.private final RegistryEntry<SoundEvent>The field for thesoundEventrecord component.private final intThe field for theuseDurationrecord component. -
Constructor Summary
Constructors -
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.floatrange()Returns the value of therangerecord component.Returns the value of thesoundEventrecord component.final StringtoString()Returns a string representation of this record class.intReturns the value of theuseDurationrecord component.
-
Field Details
-
soundEvent
The field for thesoundEventrecord component. -
useDuration
private final int useDurationThe field for theuseDurationrecord component. -
range
private final float rangeThe field for therangerecord component. -
CODEC
- Mappings:
Namespace Name Mixin selector official aLcfp;a:Lcom/mojang/serialization/Codec;intermediary field_39122Lnet/minecraft/class_7444;field_39122:Lcom/mojang/serialization/Codec;named CODECLnet/minecraft/item/Instrument;CODEC:Lcom/mojang/serialization/Codec;
-
-
Constructor Details
-
Instrument
-
-
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
-
useDuration
public int useDuration()Returns the value of theuseDurationrecord component.- Returns:
- the value of the
useDurationrecord component
-
range
public float range()Returns the value of therangerecord component.- Returns:
- the value of the
rangerecord component
-