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 enum
static interface
(package private) static class
(package private) static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ServerboundInteractPacket.Action
(package private) static final ServerboundInteractPacket.Action
private final int
static final StreamCodec
<FriendlyByteBuf, ServerboundInteractPacket> private final boolean
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ServerboundInteractPacket
(int entityId, boolean usingSecondaryAction, ServerboundInteractPacket.Action action) private
-
Method Summary
Modifier and TypeMethodDescriptionstatic ServerboundInteractPacket
createAttackPacket
(Entity entity, boolean usingSecondaryAction) static ServerboundInteractPacket
createInteractionPacket
(Entity entity, boolean usingSecondaryAction, InteractionHand hand) static ServerboundInteractPacket
createInteractionPacket
(Entity entity, boolean usingSecondaryAction, InteractionHand hand, Vec3 interactionLocation) void
getTarget
(ServerLevel level) void
handle
(ServerGamePacketListener handler) Passes this Packet on to the NetHandler for processing.boolean
type()
private void
write
(FriendlyByteBuf buffer) 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, wait
Methods 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 entityId, boolean usingSecondaryAction, ServerboundInteractPacket.Action action) -
ServerboundInteractPacket
-
-
Method Details
-
createAttackPacket
public static ServerboundInteractPacket createAttackPacket(Entity entity, boolean usingSecondaryAction) -
createInteractionPacket
public static ServerboundInteractPacket createInteractionPacket(Entity entity, boolean usingSecondaryAction, InteractionHand hand) -
createInteractionPacket
public static ServerboundInteractPacket createInteractionPacket(Entity entity, boolean usingSecondaryAction, InteractionHand hand, Vec3 interactionLocation) -
write
Writes the raw packet data to the data stream. -
type
- Specified by:
type
in interfacePacket<ServerGamePacketListener>
-
handle
Passes this Packet on to the NetHandler for processing.- Specified by:
handle
in interfacePacket<ServerGamePacketListener>
-
getTarget
-
isUsingSecondaryAction
public boolean isUsingSecondaryAction() -
dispatch
-