[Script] PacketDebugger Script
-
PacketDebugger
A packet debugger script which displays selected packets and their fields on chat bar.
About
-
Name
PacketDebugger
-
Version
1.0.0
-
Author
-
Download
ChangeLogs
-
1.0.0
Initial upload
How to use
Type command .PacketDebugger <Packet> to toggle packet's debug state.
E.G .PacketDebugger C04PacketPlayerPositionSettings
Settings Description PrintFields Displays packet's fields on chat bar PrintTime Displays the time of packet send/receive MCPField When PrintFields is on,the fields displays as MCP naming Supported Packets
C00PacketLoginStart
C01PacketEncryptionResponse
C00PacketServerQuery
C01PacketPing
C00PacketKeepAlive
C01PacketChatMessage
C02PacketUseEntity
C03PacketPlayer
C04PacketPlayerPosition
C05PacketPlayerLook
C06PacketPlayerPosLook
C07PacketPlayerDigging
C08PacketPlayerBlockPlacement
C09PacketHeldItemChange
C0APacketAnimation
C0BPacketEntityAction
C0CPacketInput
C0DPacketCloseWindow
C0EPacketClickWindow
C0FPacketConfirmTransaction
C10PacketCreativeInventoryAction
C11PacketEnchantItem
C12PacketUpdateSign
C13PacketPlayerAbilities
C14PacketTabComplete
C15PacketClientSettings
C16PacketClientStatus
C17PacketCustomPayload
C18PacketSpectate
C19PacketResourcePackStatus
C00Handshake
S00PacketDisconnect
S01PacketEncryptionRequest
S02PacketLoginSuccess
S03PacketEnableCompression
S00PacketServerInfo
S01PacketPong
S00PacketKeepAlive
S01PacketJoinGame
S02PacketChat
S03PacketTimeUpdate
S04PacketEntityEquipment
S05PacketSpawnPosition
S06PacketUpdateHealth
S07PacketRespawn
S08PacketPlayerPosLook
S09PacketHeldItemChange
S0APacketUseBed
S0BPacketAnimation
S0CPacketSpawnPlayer
S0DPacketCollectItem
S0EPacketSpawnObject
S0FPacketSpawnMob
S10PacketSpawnPainting
S11PacketSpawnExperienceOrb
S12PacketEntityVelocity
S13PacketDestroyEntities
S14PacketEntity
S15PacketEntityRelMove
S16PacketEntityLook
S17PacketEntityLookMove
S18PacketEntityTeleport
S19PacketEntityHeadLook
S19PacketEntityStatus
S1BPacketEntityAttach
S1CPacketEntityMetadata
S1DPacketEntityEffect
S1EPacketRemoveEntityEffect
S1FPacketSetExperience
S20PacketEntityProperties
S21PacketChunkData
S22PacketMultiBlockChange
S23PacketBlockChange
S24PacketBlockAction
S25PacketBlockBreakAnim
S26PacketMapChunkBulk
S27PacketExplosion
S28PacketEffect
S29PacketSoundEffect
S2APacketParticles
S2BPacketChangeGameState
S2CPacketSpawnGlobalEntity
S2DPacketOpenWindow
S2EPacketCloseWindow
S2FPacketSetSlot
S30PacketWindowItems
S31PacketWindowProperty
S32PacketConfirmTransaction
S33PacketUpdateSign
S34PacketMaps
S35PacketUpdateTileEntity
S36PacketSignEditorOpen
S37PacketStatistics
S38PacketPlayerListItem
S39PacketPlayerAbilities
S3APacketTabComplete
S3BPacketScoreboardObjective
S3CPacketUpdateScore
S3DPacketDisplayScoreboard
S3EPacketTeams
S3FPacketCustomPayload
S40PacketDisconnect
S41PacketServerDifficulty
S42PacketCombatEvent
S43PacketCamera
S44PacketWorldBorder
S45PacketTitle
S46PacketSetCompressionLevel
S47PacketPlayerListHeaderFooter
S48PacketResourcePackSend
S49PacketUpdateEntityNBT -
-
@suicidemouse because
-
Direct script src:
PacketDebugger.js/// api_version=2 var script = registerScript({ name: "PacketDebugger", version: "1.0.0", authors: ["As丶One"] }); load("nashorn:mozilla_compat.js"); importPackage( "net.minecraft.network.handshake.client", "net.minecraft.network.play.server", "net.minecraft.network.play.client", "net.minecraft.network.status.client", "net.minecraft.network.status.server", "net.minecraft.network.login.server", "net.minecraft.network.login.client", "net.ccbluex.liquidbounce.value" ); var fieldMap = {'field_148940_a': 'x', 'field_148938_b': 'y', 'field_148939_c': 'z', 'field_148936_d': 'yaw', 'field_148937_e': 'pitch', 'field_179835_f': 'field_179835_f', 'field_149018_a': 'entityId', 'field_149016_b': 'x', 'field_149017_c': 'y', 'field_149014_d': 'z', 'field_149015_e': 'speedX', 'field_149012_f': 'speedY', 'field_149013_g': 'speedZ', 'field_149021_h': 'pitch', 'field_149022_i': 'yaw', 'field_149019_j': 'type', 'field_149020_k': 'field_149020_k', 'field_148992_a': 'entityID', 'field_148990_b': 'posX', 'field_148991_c': 'posY', 'field_148988_d': 'posZ', 'field_148989_e': 'xpValue', 'field_149059_a': 'entityId', 'field_149057_b': 'x', 'field_149058_c': 'y', 'field_149055_d': 'z', 'field_149056_e': 'type', 'field_149042_a': 'entityId', 'field_149040_b': 'type', 'field_149041_c': 'x', 'field_149038_d': 'y', 'field_149039_e': 'z', 'field_149036_f': 'velocityX', 'field_149037_g': 'velocityY', 'field_149047_h': 'velocityZ', 'field_149048_i': 'yaw', 'field_149045_j': 'pitch', 'field_149046_k': 'headPitch', 'field_149043_l': 'field_149043_l', 'field_149044_m': 'watcher', 'field_148973_a': 'entityID', 'field_179838_b': 'position', 'field_179839_c': 'facing', 'field_148968_f': 'title', 'field_148957_a': 'entityId', 'field_179820_b': 'playerId', 'field_148956_c': 'x', 'field_148953_d': 'y', 'field_148954_e': 'z', 'field_148951_f': 'yaw', 'field_148952_g': 'pitch', 'field_148959_h': 'currentItem', 'field_148960_i': 'watcher', 'field_148958_j': 'field_148958_j', 'field_148981_a': 'entityId', 'field_148980_b': 'type', 'field_148976_a': 'field_148976_a', 'field_148852_a': 'breakerId', 'field_179822_b': 'position', 'field_148849_e': 'progress', 'field_179824_a': 'blockPos', 'field_148859_d': 'metadata', 'field_148860_e': 'nbt', 'field_179826_a': 'blockPosition', 'field_148872_d': 'instrument', 'field_148873_e': 'pitch', 'field_148871_f': 'block', 'field_179828_a': 'blockPosition', 'field_148883_d': 'blockState', 'field_179833_a': 'difficulty', 'field_179832_b': 'difficultyLocked', 'field_149632_a': 'matches', 'field_148919_a': 'chatComponent', 'field_179842_b': 'type', 'field_148925_b': 'chunkPosCoord', 'field_179845_b': 'changedBlocks', 'field_148894_a': 'windowId', 'field_148892_b': 'actionNumber', 'field_148893_c': 'field_148893_c', 'field_148896_a': 'windowId', 'field_148909_a': 'windowId', 'field_148907_b': 'inventoryType', 'field_148908_c': 'windowTitle', 'field_148905_d': 'slotCount', 'field_148904_f': 'entityId', 'field_148914_a': 'windowId', 'field_148913_b': 'itemStacks', 'field_149186_a': 'windowId', 'field_149184_b': 'varIndex', 'field_149185_c': 'varValue', 'field_149179_a': 'windowId', 'field_149177_b': 'slot', 'field_149178_c': 'item', 'field_149172_a': 'channel', 'field_149171_b': 'data', 'field_149167_a': 'reason', 'field_149164_a': 'entityId', 'field_149163_b': 'logicOpcode', 'field_179766_a': 'entityId', 'field_179765_b': 'tagCompound', 'field_149158_a': 'posX', 'field_149156_b': 'posY', 'field_149157_c': 'posZ', 'field_149154_d': 'strength', 'field_149155_e': 'affectedBlockPositions', 'field_149152_f': 'field_149152_f', 'field_149153_g': 'field_149153_g', 'field_149159_h': 'field_149159_h', 'field_179761_a': 'threshold', 'field_149142_a': 'MESSAGE_NAMES', 'field_149140_b': 'state', 'field_149141_c': 'field_149141_c', 'field_149136_a': 'id', 'field_149284_a': 'chunkX', 'field_149282_b': 'chunkZ', 'field_179758_c': 'extractedData', 'field_149279_g': 'field_149279_g', 'field_149266_a': 'xPositions', 'field_149264_b': 'zPositions', 'field_179755_c': 'chunksData', 'field_149267_h': 'isOverworld', 'field_149251_a': 'soundType', 'field_179747_b': 'soundPos', 'field_149249_b': 'soundData', 'field_149246_f': 'serverWide', 'field_179751_a': 'particleType', 'field_149234_b': 'xCoord', 'field_149235_c': 'yCoord', 'field_149232_d': 'zCoord', 'field_149233_e': 'xOffset', 'field_149230_f': 'yOffset', 'field_149231_g': 'zOffset', 'field_149237_h': 'particleSpeed', 'field_149238_i': 'particleCount', 'field_179752_j': 'longDistance', 'field_179753_k': 'particleArguments', 'field_149219_a': 'soundName', 'field_149217_b': 'posX', 'field_149218_c': 'posY', 'field_149215_d': 'posZ', 'field_149216_e': 'soundVolume', 'field_149214_f': 'soundPitch', 'field_149206_a': 'entityId', 'field_149204_b': 'hardcoreMode', 'field_149205_c': 'gameType', 'field_149202_d': 'dimension', 'field_149203_e': 'difficulty', 'field_149200_f': 'maxPlayers', 'field_149201_g': 'worldType', 'field_179745_h': 'reducedDebugInfo', 'field_149191_a': 'mapId', 'field_179739_b': 'mapScale', 'field_179740_c': 'mapVisiblePlayersVec4b', 'field_179737_d': 'mapMinX', 'field_179738_e': 'mapMinY', 'field_179735_f': 'mapMaxX', 'field_179736_g': 'mapMaxY', 'field_179741_h': 'mapDataBytes', 'field_149074_a': 'entityId', 'field_149072_b': 'posX', 'field_149073_c': 'posY', 'field_149070_d': 'posZ', 'field_149071_e': 'yaw', 'field_149068_f': 'pitch', 'field_179743_g': 'onGround', 'field_149069_g': 'field_149069_g', 'field_179778_a': 'signPosition', 'field_149119_a': 'invulnerable', 'field_149117_b': 'flying', 'field_149118_c': 'allowFlying', 'field_149115_d': 'creativeMode', 'field_149116_e': 'flySpeed', 'field_149114_f': 'walkSpeed', 'field_179776_a': 'eventType', 'field_179774_b': 'field_179774_b', 'field_179775_c': 'field_179775_c', 'field_179772_d': 'field_179772_d', 'field_179773_e': 'deathMessage', 'field_179770_a': 'action', 'field_179769_b': 'players', 'field_149097_a': 'playerID', 'field_179799_b': 'bedPos', 'field_149100_a': 'entityIDs', 'field_149079_a': 'entityId', 'field_149078_b': 'effectId', 'field_179786_a': 'url', 'field_179785_b': 'hash', 'field_149088_a': 'dimensionID', 'field_149086_b': 'difficulty', 'field_149087_c': 'gameType', 'field_149085_d': 'worldType', 'field_149384_a': 'entityId', 'field_149383_b': 'yaw', 'field_179795_a': 'action', 'field_179793_b': 'size', 'field_179794_c': 'centerX', 'field_179791_d': 'centerZ', 'field_179792_e': 'targetSize', 'field_179789_f': 'diameter', 'field_179790_g': 'timeUntilTarget', 'field_179796_h': 'warningTime', 'field_179797_i': 'warningDistance', 'field_179781_a': 'entityId', 'field_149387_a': 'heldItemHotbarIndex', 'field_149374_a': 'position', 'field_149373_b': 'scoreName', 'field_149379_a': 'entityId', 'field_149378_b': 'field_149378_b', 'field_149408_a': 'leash', 'field_149406_b': 'entityId', 'field_149407_c': 'vehicleEntityId', 'field_149417_a': 'entityID', 'field_149415_b': 'motionX', 'field_149416_c': 'motionY', 'field_149414_d': 'motionZ', 'field_149394_a': 'entityID', 'field_149392_b': 'equipmentSlot', 'field_149393_c': 'itemStack', 'field_149401_a': 'field_149401_a', 'field_149399_b': 'totalExperience', 'field_149400_c': 'level', 'field_149336_a': 'health', 'field_149334_b': 'foodLevel', 'field_149335_c': 'saturationLevel', 'field_149343_a': 'objectiveName', 'field_149341_b': 'objectiveValue', 'field_179818_c': 'type', 'field_149342_c': 'field_149342_c', 'field_149320_a': 'name', 'field_149318_b': 'displayName', 'field_149319_c': 'prefix', 'field_149316_d': 'suffix', 'field_179816_e': 'nameTagVisibility', 'field_179815_f': 'color', 'field_149317_e': 'players', 'field_149314_f': 'action', 'field_149315_g': 'friendlyFlags', 'field_149329_a': 'name', 'field_149327_b': 'objective', 'field_149328_c': 'value', 'field_149326_d': 'action', 'field_179801_a': 'spawnBlockPos', 'field_149369_a': 'totalWorldTime', 'field_149368_b': 'worldTime', 'field_179812_a': 'type', 'field_179810_b': 'message', 'field_179811_c': 'fadeInTime', 'field_179808_d': 'displayTime', 'field_179809_e': 'fadeOutTime', 'field_179706_a': 'world', 'field_179705_b': 'blockPos', 'field_149349_d': 'lines', 'field_179703_a': 'header', 'field_179702_b': 'footer', 'field_149357_a': 'collectedItemEntityId', 'field_149356_b': 'entityId', 'field_149458_a': 'entityId', 'field_149456_b': 'posX', 'field_149457_c': 'posY', 'field_149454_d': 'posZ', 'field_149455_e': 'yaw', 'field_149453_f': 'pitch', 'field_179698_g': 'onGround', 'field_149445_a': 'entityId', 'field_149444_b': 'field_149444_b', 'field_149434_a': 'entityId', 'field_149432_b': 'effectId', 'field_149433_c': 'amplifier', 'field_149431_d': 'duration', 'field_179708_e': 'hideParticles', 'field_149420_a': 'message', 'field_179710_b': 'targetBlock', 'field_149440_a': 'message', 'field_149437_a': 'status', 'field_149530_a': 'lang', 'field_149528_b': 'view', 'field_149529_c': 'chatVisibility', 'field_149526_d': 'enableColors', 'field_179711_e': 'modelPartFlags', 'field_149536_a': 'windowId', 'field_149534_b': 'uid', 'field_149535_c': 'accepted', 'field_149541_a': 'windowId', 'field_149540_b': 'button', 'field_149554_a': 'windowId', 'field_149552_b': 'slotId', 'field_149553_c': 'usedButton', 'field_149550_d': 'actionNumber', 'field_149551_e': 'clickedItem', 'field_149549_f': 'mode', 'field_149556_a': 'windowId', 'field_149562_a': 'channel', 'field_149561_c': 'data', 'field_149567_a': 'entityId', 'field_149566_b': 'action', 'field_179713_c': 'hitVec', 'field_149461_a': 'key', 'field_149479_a': 'x', 'field_149477_b': 'y', 'field_149478_c': 'z', 'field_149476_e': 'yaw', 'field_149473_f': 'pitch', 'field_149474_g': 'onGround', 'field_149480_h': 'moving', 'field_149481_i': 'rotating', 'field_149500_a': 'invulnerable', 'field_149498_b': 'flying', 'field_149499_c': 'allowFlying', 'field_149496_d': 'creativeMode', 'field_149497_e': 'flySpeed', 'field_149495_f': 'walkSpeed', 'field_179717_a': 'position', 'field_179716_b': 'facing', 'field_149508_e': 'status', 'field_149517_a': 'entityID', 'field_149515_b': 'action', 'field_149516_c': 'auxData', 'field_149624_a': 'strafeSpeed', 'field_149622_b': 'forwardSpeed', 'field_149623_c': 'jumping', 'field_149621_d': 'sneaking', 'field_179720_a': 'hash', 'field_179719_b': 'status', 'field_149615_a': 'slotId', 'field_149629_a': 'slotId', 'field_149628_b': 'stack', 'field_179723_a': 'pos', 'field_149590_d': 'lines', 'field_179729_a': 'id', 'field_179726_a': 'field_179726_a', 'field_179725_b': 'position', 'field_149579_d': 'placedBlockDirection', 'field_149580_e': 'stack', 'field_149577_f': 'facingX', 'field_149578_g': 'facingY', 'field_149584_h': 'facingZ', 'field_149602_a': 'profile', 'field_149612_a': 'hashedServerId', 'field_149610_b': 'publicKey', 'field_149611_c': 'verifyToken', 'field_179733_a': 'compressionTreshold', 'field_149605_a': 'reason', 'field_149305_a': 'profile', 'field_149302_a': 'secretKeyEncrypted', 'field_149301_b': 'verifyTokenEncrypted', 'field_149293_a': 'clientTime', 'field_149297_a': 'GSON', 'field_149296_b': 'response', 'field_149290_a': 'clientTime'} var packetClasses = [C00PacketLoginStart, C01PacketEncryptionResponse, C00PacketServerQuery, C01PacketPing, C00PacketKeepAlive, C01PacketChatMessage, C02PacketUseEntity, C03PacketPlayer, C03PacketPlayer.C04PacketPlayerPosition, C03PacketPlayer.C05PacketPlayerLook, C03PacketPlayer.C06PacketPlayerPosLook, C07PacketPlayerDigging, C08PacketPlayerBlockPlacement, C09PacketHeldItemChange, C0APacketAnimation, C0BPacketEntityAction, C0CPacketInput, C0DPacketCloseWindow, C0EPacketClickWindow, C0FPacketConfirmTransaction, C10PacketCreativeInventoryAction, C11PacketEnchantItem, C12PacketUpdateSign, C13PacketPlayerAbilities, C14PacketTabComplete, C15PacketClientSettings, C16PacketClientStatus, C17PacketCustomPayload, C18PacketSpectate, C19PacketResourcePackStatus, C00Handshake, S00PacketDisconnect, S01PacketEncryptionRequest, S02PacketLoginSuccess, S03PacketEnableCompression, S00PacketServerInfo, S01PacketPong, S00PacketKeepAlive, S01PacketJoinGame, S02PacketChat, S03PacketTimeUpdate, S04PacketEntityEquipment, S05PacketSpawnPosition, S06PacketUpdateHealth, S07PacketRespawn, S08PacketPlayerPosLook, S09PacketHeldItemChange, S0APacketUseBed, S0BPacketAnimation, S0CPacketSpawnPlayer, S0DPacketCollectItem, S0EPacketSpawnObject, S0FPacketSpawnMob, S10PacketSpawnPainting, S11PacketSpawnExperienceOrb, S12PacketEntityVelocity, S13PacketDestroyEntities, S14PacketEntity, S14PacketEntity.S15PacketEntityRelMove, S14PacketEntity.S16PacketEntityLook, S14PacketEntity.S17PacketEntityLookMove, S18PacketEntityTeleport, S19PacketEntityHeadLook, S19PacketEntityStatus, S1BPacketEntityAttach, S1CPacketEntityMetadata, S1DPacketEntityEffect, S1EPacketRemoveEntityEffect, S1FPacketSetExperience, S20PacketEntityProperties, S21PacketChunkData, S22PacketMultiBlockChange, S23PacketBlockChange, S24PacketBlockAction, S25PacketBlockBreakAnim, S26PacketMapChunkBulk, S27PacketExplosion, S28PacketEffect, S29PacketSoundEffect, S2APacketParticles, S2BPacketChangeGameState, S2CPacketSpawnGlobalEntity, S2DPacketOpenWindow, S2EPacketCloseWindow, S2FPacketSetSlot, S30PacketWindowItems, S31PacketWindowProperty, S32PacketConfirmTransaction, S33PacketUpdateSign, S34PacketMaps, S35PacketUpdateTileEntity, S36PacketSignEditorOpen, S37PacketStatistics, S38PacketPlayerListItem, S39PacketPlayerAbilities, S3APacketTabComplete, S3BPacketScoreboardObjective, S3CPacketUpdateScore, S3DPacketDisplayScoreboard, S3EPacketTeams, S3FPacketCustomPayload, S40PacketDisconnect, S41PacketServerDifficulty, S42PacketCombatEvent, S43PacketCamera, S44PacketWorldBorder, S45PacketTitle, S46PacketSetCompressionLevel, S47PacketPlayerListHeaderFooter, S48PacketResourcePackSend, S49PacketUpdateEntityNBT] var printFields = Setting.boolean({ name: "PrintFields", default: true }) var printTime = Setting.boolean({ name: "PrintTime", default: true }) var mcpField = Setting.boolean({ name: "MCPField", default: true }) var settings = { printFields: printFields, printTime: printTime, mcpField: mcpField } var packetDebugStates = new java.util.HashMap() for each(var packetClass in packetClasses) { settings[packetClass.class.getSimpleName()] = new ( Java.extend( BoolValue, { onChange: function (oldValue, newValue) { packetDebugStates[this.class.getName()] = newValue; }, fromJson: function (element) { if (element.isJsonPrimitive()) { settings[this.class.getSimpleName()].set( element.getAsBoolean() || element.getAsString().toLowerCase() === "true" ) } }, class: packetClass.class } ) )(packetClass.class.getSimpleName(), false); } script.registerModule({ name: "PacketDebugger", description: "PacketDebugger By As丶One", category: "Fun", settings: settings }, function (module) { module.on("packet", function (event) { var packet = event.getPacket() var clazz = event.getPacket().class if (packetDebugStates[clazz.getName()]) { Chat.print(clazz.getSimpleName() + (printTime.get() ? " " + java.lang.System.currentTimeMillis() % 0xFFFFfF : "")) if (printFields.get()) { if (clazz.isMemberClass()) { clazz = clazz.getDeclaringClass() } for each(var field in clazz.getDeclaredFields()) { field.setAccessible(true) Chat.print(" " + (mcpField.get() ? fieldMap[field.getName()] : field.getName()) + " : " + field.get(packet)) } } } }) })
-
-
Very cool!