How does "Execute as if it were typed by player"? Work

How does it work?

Do you mean what does it do?

It does exactly what it sounds. It will perform an action as if the player had typed that command. If you want them to 'go west' or 'pick up the sword' it will do just that. It can be easier than doing these actions behind the scenes.

yah but i have one that will decrement my health but he does not do it? How is it activated?