The /execute command can not detect player as the target.
/execute @e ~ ~ ~ detect ~ ~-1 ~ stone -1 kill @p
This command will kill the player (in survival mode) if any entities stand on a stone block. But in this case the player won't trigger the command, even though the player is an entity as well.
This problem can also be done with @p as the target:
/execute @p ~ ~ ~ detect ~ ~-1 ~ stone -1 kill @p
Thank you for your report!
However, this issue has been closed as Cannot Reproduce.
We were unable to reproduce the problem you are describing. I'm trying to work through the /execute command bugs, and I noticed that your example is trying to detect an invalid block id (Stone -1).
I think the issue here is the relative position not working correctly, as detailed in MCPE-20543.
Quick Links:
📓 Issue Guidelines – 💬 Community Support – 📧 Feedback – 📖 Game Wiki