Interface Packet

All Known Subinterfaces:
MinecraftPacket
All Known Implementing Classes:
ClientboundAddEntityPacket, ClientboundAnimatePacket, ClientboundAwardStatsPacket, ClientboundBlockChangedAckPacket, ClientboundBlockDestructionPacket, ClientboundBlockEntityDataPacket, ClientboundBlockEventPacket, ClientboundBlockUpdatePacket, ClientboundBossEventPacket, ClientboundBundlePacket, ClientboundChangeDifficultyPacket, ClientboundChunkBatchFinishedPacket, ClientboundChunkBatchStartPacket, ClientboundChunksBiomesPacket, ClientboundClearDialogPacket, ClientboundClearTitlesPacket, ClientboundCodeOfConductPacket, ClientboundCommandsPacket, ClientboundCommandSuggestionsPacket, ClientboundContainerClosePacket, ClientboundContainerSetContentPacket, ClientboundContainerSetDataPacket, ClientboundContainerSetSlotPacket, ClientboundCookieRequestPacket, ClientboundCooldownPacket, ClientboundCustomChatCompletionsPacket, ClientboundCustomPayloadPacket, ClientboundCustomQueryPacket, ClientboundCustomReportDetailsPacket, ClientboundDamageEventPacket, ClientboundDebugBlockValuePacket, ClientboundDebugChunkValuePacket, ClientboundDebugEntityValuePacket, ClientboundDebugEventPacket, ClientboundDebugSamplePacket, ClientboundDeleteChatPacket, ClientboundDelimiterPacket, ClientboundDisconnectPacket, ClientboundDisguisedChatPacket, ClientboundEntityEventPacket, ClientboundEntityPositionSyncPacket, ClientboundExplodePacket, ClientboundFinishConfigurationPacket, ClientboundForgetLevelChunkPacket, ClientboundGameEventPacket, ClientboundGameTestHighlightPosPacket, ClientboundHelloPacket, ClientboundHurtAnimationPacket, ClientboundInitializeBorderPacket, ClientboundKeepAlivePacket, ClientboundLevelChunkWithLightPacket, ClientboundLevelEventPacket, ClientboundLevelParticlesPacket, ClientboundLightUpdatePacket, ClientboundLoginCompressionPacket, ClientboundLoginDisconnectPacket, ClientboundLoginFinishedPacket, ClientboundLoginPacket, ClientboundMapItemDataPacket, ClientboundMerchantOffersPacket, ClientboundMountScreenOpenPacket, ClientboundMoveEntityPosPacket, ClientboundMoveEntityPosRotPacket, ClientboundMoveEntityRotPacket, ClientboundMoveMinecartPacket, ClientboundMoveVehiclePacket, ClientboundOpenBookPacket, ClientboundOpenScreenPacket, ClientboundOpenSignEditorPacket, ClientboundPingPacket, ClientboundPlaceGhostRecipePacket, ClientboundPlayerAbilitiesPacket, ClientboundPlayerChatPacket, ClientboundPlayerCombatEndPacket, ClientboundPlayerCombatEnterPacket, ClientboundPlayerCombatKillPacket, ClientboundPlayerInfoRemovePacket, ClientboundPlayerInfoUpdatePacket, ClientboundPlayerLookAtPacket, ClientboundPlayerPositionPacket, ClientboundPlayerRotationPacket, ClientboundPongResponsePacket, ClientboundProjectilePowerPacket, ClientboundRecipeBookAddPacket, ClientboundRecipeBookRemovePacket, ClientboundRecipeBookSettingsPacket, ClientboundRegistryDataPacket, ClientboundRemoveEntitiesPacket, ClientboundRemoveMobEffectPacket, ClientboundResetChatPacket, ClientboundResetScorePacket, ClientboundResourcePackPopPacket, ClientboundResourcePackPushPacket, ClientboundRespawnPacket, ClientboundRotateHeadPacket, ClientboundSectionBlocksUpdatePacket, ClientboundSelectAdvancementsTabPacket, ClientboundSelectKnownPacks, ClientboundServerDataPacket, ClientboundServerLinksPacket, ClientboundSetActionBarTextPacket, ClientboundSetBorderCenterPacket, ClientboundSetBorderLerpSizePacket, ClientboundSetBorderSizePacket, ClientboundSetBorderWarningDelayPacket, ClientboundSetBorderWarningDistancePacket, ClientboundSetCameraPacket, ClientboundSetChunkCacheCenterPacket, ClientboundSetChunkCacheRadiusPacket, ClientboundSetCursorItemPacket, ClientboundSetDefaultSpawnPositionPacket, ClientboundSetDisplayObjectivePacket, ClientboundSetEntityDataPacket, ClientboundSetEntityLinkPacket, ClientboundSetEntityMotionPacket, ClientboundSetEquipmentPacket, ClientboundSetExperiencePacket, ClientboundSetHealthPacket, ClientboundSetHeldSlotPacket, ClientboundSetObjectivePacket, ClientboundSetPassengersPacket, ClientboundSetPlayerInventoryPacket, ClientboundSetPlayerTeamPacket, ClientboundSetScorePacket, ClientboundSetSimulationDistancePacket, ClientboundSetSubtitleTextPacket, ClientboundSetTimePacket, ClientboundSetTitlesAnimationPacket, ClientboundSetTitleTextPacket, ClientboundShowDialogConfigurationPacket, ClientboundShowDialogGamePacket, ClientboundSoundEntityPacket, ClientboundSoundPacket, ClientboundStartConfigurationPacket, ClientboundStatusResponsePacket, ClientboundStopSoundPacket, ClientboundStoreCookiePacket, ClientboundSystemChatPacket, ClientboundTabListPacket, ClientboundTagQueryPacket, ClientboundTakeItemEntityPacket, ClientboundTeleportEntityPacket, ClientboundTestInstanceBlockStatus, ClientboundTickingStatePacket, ClientboundTickingStepPacket, ClientboundTrackedWaypointPacket, ClientboundTransferPacket, ClientboundUpdateAdvancementsPacket, ClientboundUpdateAttributesPacket, ClientboundUpdateEnabledFeaturesPacket, ClientboundUpdateMobEffectPacket, ClientboundUpdateRecipesPacket, ClientboundUpdateTagsPacket, ClientIntentionPacket, ServerboundAcceptCodeOfConductPacket, ServerboundAcceptTeleportationPacket, ServerboundBlockEntityTagQueryPacket, ServerboundChangeDifficultyPacket, ServerboundChangeGameModePacket, ServerboundChatAckPacket, ServerboundChatCommandPacket, ServerboundChatCommandSignedPacket, ServerboundChatPacket, ServerboundChatSessionUpdatePacket, ServerboundChunkBatchReceivedPacket, ServerboundClientCommandPacket, ServerboundClientInformationPacket, ServerboundClientTickEndPacket, ServerboundCommandSuggestionPacket, ServerboundConfigurationAcknowledgedPacket, ServerboundContainerButtonClickPacket, ServerboundContainerClickPacket, ServerboundContainerClosePacket, ServerboundContainerSlotStateChangedPacket, ServerboundCookieResponsePacket, ServerboundCustomClickActionPacket, ServerboundCustomPayloadPacket, ServerboundCustomQueryAnswerPacket, ServerboundDebugSubscriptionRequestPacket, ServerboundEditBookPacket, ServerboundEntityTagQuery, ServerboundFinishConfigurationPacket, ServerboundHelloPacket, ServerboundInteractPacket, ServerboundJigsawGeneratePacket, ServerboundKeepAlivePacket, ServerboundKeyPacket, ServerboundLockDifficultyPacket, ServerboundLoginAcknowledgedPacket, ServerboundMovePlayerPosPacket, ServerboundMovePlayerPosRotPacket, ServerboundMovePlayerRotPacket, ServerboundMovePlayerStatusOnlyPacket, ServerboundMoveVehiclePacket, ServerboundPaddleBoatPacket, ServerboundPickItemFromBlockPacket, ServerboundPickItemFromEntityPacket, ServerboundPingRequestPacket, ServerboundPlaceRecipePacket, ServerboundPlayerAbilitiesPacket, ServerboundPlayerActionPacket, ServerboundPlayerCommandPacket, ServerboundPlayerInputPacket, ServerboundPlayerLoadedPacket, ServerboundPongPacket, ServerboundRecipeBookChangeSettingsPacket, ServerboundRecipeBookSeenRecipePacket, ServerboundRenameItemPacket, ServerboundResourcePackPacket, ServerboundSeenAdvancementsPacket, ServerboundSelectBundleItemPacket, ServerboundSelectKnownPacks, ServerboundSelectTradePacket, ServerboundSetBeaconPacket, ServerboundSetCarriedItemPacket, ServerboundSetCommandBlockPacket, ServerboundSetCommandMinecartPacket, ServerboundSetCreativeModeSlotPacket, ServerboundSetJigsawBlockPacket, ServerboundSetStructureBlockPacket, ServerboundSetTestBlockPacket, ServerboundSignUpdatePacket, ServerboundStatusRequestPacket, ServerboundSwingPacket, ServerboundTeleportToEntityPacket, ServerboundTestInstanceBlockActionPacket, ServerboundUseItemOnPacket, ServerboundUseItemPacket

public interface Packet
A network packet. Any given packet must have a constructor that takes in a ByteBuf.
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    Returns whether the packet is terminal.
    default boolean
    Gets whether the packet should run on an async game thread rather than blocking the network (Netty) thread.
  • Method Details

    • shouldRunOnGameThread

      default boolean shouldRunOnGameThread()
      Gets whether the packet should run on an async game thread rather than blocking the network (Netty) thread. Packets that qualify for this are usually packets with an ensureRunningOnSameThread call at the top of their packet listener method in the Minecraft code. Packets which need extra attention because they aren't "fully" handled async are marked using // GAME THREAD DETAIL comments in the MCProtocolLib code.
      Returns:
      Whether the packet be handled async from the Netty thread.
    • isTerminal

      default boolean isTerminal()
      Returns whether the packet is terminal. If true, this should be the last packet sent inside a protocol state. Subsequently, Session.setAutoRead(boolean) should be disabled when a terminal packet is received, until the session has switched into a new state and is ready to receive more packets.
      Returns:
      Whether the packet is terminal.