Record Class ServerboundInteractPacket
java.lang.Object
java.lang.Record
net.minecraft.network.protocol.game.ServerboundInteractPacket
- All Implemented Interfaces:
Packet<ServerGamePacketListener>
public record ServerboundInteractPacket(int entityId, InteractionHand hand, Vec3 location, boolean usingSecondaryAction)
extends Record
implements Packet<ServerGamePacketListener>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intThe field for theentityIdrecord component.private final InteractionHandThe field for thehandrecord component.private final Vec3The field for thelocationrecord component.static final StreamCodec<io.netty.buffer.ByteBuf, ServerboundInteractPacket> private final booleanThe field for theusingSecondaryActionrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionServerboundInteractPacket(int entityId, InteractionHand hand, Vec3 location, boolean usingSecondaryAction) Creates an instance of aServerboundInteractPacketrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintentityId()Returns the value of theentityIdrecord component.final booleanIndicates whether some other object is "equal to" this one.hand()Returns the value of thehandrecord component.voidhandle(ServerGamePacketListener listener) Passes this Packet on to the NetHandler for processing.final inthashCode()Returns a hash code value for this object.location()Returns the value of thelocationrecord component.final StringtoString()Returns a string representation of this record class.type()booleanReturns the value of theusingSecondaryActionrecord component.Methods inherited from interface Packet
isSkippable, isTerminal
-
Field Details
-
entityId
private final int entityIdThe field for theentityIdrecord component. -
hand
The field for thehandrecord component. -
location
The field for thelocationrecord component. -
usingSecondaryAction
private final boolean usingSecondaryActionThe field for theusingSecondaryActionrecord component. -
STREAM_CODEC
-
-
Constructor Details
-
ServerboundInteractPacket
public ServerboundInteractPacket(int entityId, InteractionHand hand, Vec3 location, boolean usingSecondaryAction) Creates an instance of aServerboundInteractPacketrecord class.- Parameters:
entityId- the value for theentityIdrecord componenthand- the value for thehandrecord componentlocation- the value for thelocationrecord componentusingSecondaryAction- the value for theusingSecondaryActionrecord component
-
-
Method Details
-
type
- Specified by:
typein interfacePacket<ServerGamePacketListener>
-
handle
Passes this Packet on to the NetHandler for processing.- Specified by:
handlein interfacePacket<ServerGamePacketListener>
-
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. -
entityId
public int entityId()Returns the value of theentityIdrecord component.- Returns:
- the value of the
entityIdrecord component
-
hand
Returns the value of thehandrecord component.- Returns:
- the value of the
handrecord component
-
location
Returns the value of thelocationrecord component.- Returns:
- the value of the
locationrecord component
-
usingSecondaryAction
public boolean usingSecondaryAction()Returns the value of theusingSecondaryActionrecord component.- Returns:
- the value of the
usingSecondaryActionrecord component
-