Minecraft wiki entry for Zombified_piglin_farming, associated text: Put hoppers connected to a large chest to collect the loot more easily rather than attaching a door to the trench since more zombified piglins might jump in and attack.