Record Class LivingEntity.SwingDescription
java.lang.Object
java.lang.Record
net.minecraft.world.entity.LivingEntity.SwingDescription
- Enclosing class:
LivingEntity
public static record LivingEntity.SwingDescription(InteractionHand hand, SwingAnimation animation, int durationTicks)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final SwingAnimationThe field for theanimationrecord component.private final intThe field for thedurationTicksrecord component.private final InteractionHandThe field for thehandrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionSwingDescription(InteractionHand hand, SwingAnimation animation, int durationTicks) Creates an instance of aSwingDescriptionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theanimationrecord component.intReturns the value of thedurationTicksrecord component.final booleanIndicates whether some other object is "equal to" this one.hand()Returns the value of thehandrecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
hand
The field for thehandrecord component. -
animation
The field for theanimationrecord component. -
durationTicks
private final int durationTicksThe field for thedurationTicksrecord component.
-
-
Constructor Details
-
SwingDescription
Creates an instance of aSwingDescriptionrecord class.- Parameters:
hand- the value for thehandrecord componentanimation- the value for theanimationrecord componentdurationTicks- the value for thedurationTicksrecord component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
hand
Returns the value of thehandrecord component.- Returns:
- the value of the
handrecord component
-
animation
Returns the value of theanimationrecord component.- Returns:
- the value of the
animationrecord component
-
durationTicks
public int durationTicks()Returns the value of thedurationTicksrecord component.- Returns:
- the value of the
durationTicksrecord component
-