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 entityId, boolean usingSecondaryAction, ServerboundInteractPacket.Action action) private -
Method Summary
Modifier and TypeMethodDescriptionstatic ServerboundInteractPacketcreateAttackPacket(Entity entity, boolean usingSecondaryAction) static ServerboundInteractPacketcreateInteractionPacket(Entity entity, boolean usingSecondaryAction, InteractionHand hand) static ServerboundInteractPacketcreateInteractionPacket(Entity entity, boolean usingSecondaryAction, InteractionHand hand, Vec3 interactionLocation) voidgetTarget(ServerLevel level) voidhandle(ServerGamePacketListener handler) Passes this Packet on to the NetHandler for processing.booleantype()private voidwrite(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, 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 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:
typein interfacePacket<ServerGamePacketListener>
-
handle
Passes this Packet on to the NetHandler for processing.- Specified by:
handlein interfacePacket<ServerGamePacketListener>
-
getTarget
-
isUsingSecondaryAction
public boolean isUsingSecondaryAction() -
dispatch
-