In Minecraft Java, it is quite straightforward. Press keys F3 and B on the keyboard of your workstation simultaneously. This will flip hitboxes on and off for you. Hitboxes look like straight lines around hordes and NPCs and can decide substance position.