This is the secret sauce. You need a clock that pulses every 30 ticks.
For a combat trap (fast spawners), use 1 item in the hopper clock. This creates a 30-game-tick pulse (1.5 seconds). For a player trap, use 30 items for a 30-second delay. lovely craft piston trap 30 full
At the bottom, 30 blocks below, is a 1x1 waterless drop zone surrounded by obsidian (to prevent explosion damage). Here, the "Full" comes into play. Instead of letting mobs survive with half a heart, you add a crusher – two extra sticky pistons that push a block back and forth, dealing constant suffocation damage. Or, even simpler: the 1x1 hole has 24 minecarts stacked inside, causing entity cramming (the game forces entities to take damage when more than 24 occupy one block). In 3 seconds, all softened mobs die, dropping XP orbs into a hopper chain leading to your storage system. Lovely Craft Piston Trap — 30-Full Guide Step
Before we place a single block of redstone dust, let’s break down the terminology: Build a repeater loop : Place redstone dust in a circle