Class ServerboundInteractPacket
java.lang.Object
net.minecraft.network.protocol.game.ServerboundInteractPacket
- All Implemented Interfaces:
Packet<ServerGamePacketListener>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static interface(package private) static enumstatic interface(package private) static class(package private) static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ServerboundInteractPacket.Action(package private) static final ServerboundInteractPacket.Actionprivate final intstatic final StreamCodec<FriendlyByteBuf, ServerboundInteractPacket> private final boolean -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateServerboundInteractPacket(int pEntityId, boolean pUsingSecondaryAction, ServerboundInteractPacket.Action pAction) privateServerboundInteractPacket(FriendlyByteBuf pBuffer) -
Method Summary
Modifier and TypeMethodDescriptionstatic ServerboundInteractPacketcreateAttackPacket(Entity pEntity, boolean pUsingSecondaryAction) static ServerboundInteractPacketcreateInteractionPacket(Entity pEntity, boolean pUsingSecondaryAction, InteractionHand pHand) static ServerboundInteractPacketcreateInteractionPacket(Entity pEntity, boolean pUsingSecondaryAction, InteractionHand pHand, Vec3 pInteractionLocation) voiddispatch(ServerboundInteractPacket.Handler pHandler) getTarget(ServerLevel pLevel) voidhandle(ServerGamePacketListener pHandler) Passes this Packet on to the NetHandler for processing.booleantype()private voidwrite(FriendlyByteBuf pBuffer) Writes the raw packet data to the data stream.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.network.protocol.Packet
isSkippable, isTerminal
-
Field Details
-
STREAM_CODEC
-
entityId
private final int entityId -
action
-
usingSecondaryAction
private final boolean usingSecondaryAction -
ATTACK_ACTION
-
-
Constructor Details
-
ServerboundInteractPacket
private ServerboundInteractPacket(int pEntityId, boolean pUsingSecondaryAction, ServerboundInteractPacket.Action pAction) -
ServerboundInteractPacket
-
-
Method Details
-
createAttackPacket
public static ServerboundInteractPacket createAttackPacket(Entity pEntity, boolean pUsingSecondaryAction) -
createInteractionPacket
public static ServerboundInteractPacket createInteractionPacket(Entity pEntity, boolean pUsingSecondaryAction, InteractionHand pHand) -
createInteractionPacket
public static ServerboundInteractPacket createInteractionPacket(Entity pEntity, boolean pUsingSecondaryAction, InteractionHand pHand, Vec3 pInteractionLocation) -
write
Writes the raw packet data to the data stream. -
type
- Specified by:
typein interfacePacket<ServerGamePacketListener>
-
handle
Passes this Packet on to the NetHandler for processing.- Specified by:
handlein interfacePacket<ServerGamePacketListener>
-
getTarget
-
isUsingSecondaryAction
public boolean isUsingSecondaryAction() -
dispatch
-