Gadget - Minecraft Debugging Tools
Gadget is a collection of useful tools for analyzing and examining various game elements directly during gameplay. Essentially, it's analogous to developer tools in browsers, but specifically adapted for Minecraft.
All debugging functions work both in single player and on servers - provided that the server also has this mod installed.
Entity Inspector

Aim at any entity or data block and press the Inspect (default: I) key to view and modify the internal Java fields of the object. You can analyze both client and server Java objects.
NBT Data Viewer

Hover over an item with NBT data and use the Inspect (default: I) key to open the interface for viewing and editing NBT information.
Network Packet Analyzer

Press Dump Packets (default: K) to start recording network traffic. You can also connect to a server with packet recording already enabled by selecting the Join and start dumping packets option in the connection menu.
Pressing Dump Packets again will stop the recording and save the results. You can view the saved data through the Gadget menu.
Interface Inspector

Hold the Ctrl+Shift combination and hover over interface elements to see information about their sizes, coordinates, and type.
For Server Owners
The mod supports the Fabric Permissions API. If this API is not installed, operator privileges are required by default.
The following permissions are available:
gadget.inspect - permission to use the entity inspector
gadget.replaceStack - permission to write through the NBT viewer