Minecraft 1.14 certain number of items should command trigger?

Cl
2

I ask two directly. Is it possible to execute a command that if you eg. 5 emeralds did you teleport or execute a tellraw command? And is it possible that if you zbs. 2 swords in a crafting table that then also triggers a command?

I'm currently building a map and the 2 commands are important.

Could someone please help me here?

Br

You could do it in such a way that you make a pressure plate at a point (but in such a way that you need the emeralds) and thereby a command block is activated.

Cl

Yes, but what should I write