If you want to generate your own Execute/detect commands, You can use this generator. This generator generate a Execute command wich have the detect tag, Only detect, That Detects a block relative to a Entity The generator ask you some needs to generate what you would like to do.