Yes, just get the player object and set the variable "blocked" to true, but this will also block other actions like block placement and item usage, ...