Hello, I am very beginner with the subject of mechanisms. Would you help me with this? How can I make the piston activate when a mob appears in front of the observer? I don’t understand why it doesn’t work or how I could make it work :(
(this is a mob farm)

https://preview.redd.it/t58ghjiwj32c1.png?width=1920&format=png&auto=webp&s=5ecc7caadbd0198a245e9ba61298c0762ae57000

https://preview.redd.it/zwye7h8xj32c1.png?width=1920&format=png&auto=webp&s=c875ae8c13f36a5b76920847b30e8b57f0a4db9f