Once you’ve unlocked the achievement, why stop there? You can adapt this exact redstone logic to create:

To build the required contraption, you need specific materials. Since this guide focuses on the mechanics, note that Lovely Craft has tweaked some recipe costs.

Stand near the trap with raw meat (for pigs) or let a zombie chase you. When mob is , pull the lever.