on command: set {_test} to 0 loop blocks in radius 5 around player: if loop-block is end portal: set {_test} to 1 exit 1 loop if {_test} is 0: send "&cblah blah blah" to player cancel event