To put it simply, we have three choices : 

```javascript
// check the state inside the function
client.on(0x00, function(packet) {
  if (client.state !== states.PLAY) return;
  // do your stuff
}

// have the state as part of the event
client.on([states.PLAY, 0x00], function(packet) {
  // do your stuff
}

// Have specially named event for other states
client.on('handshake', function(packet) {
  // do your stuff
}
```

I settled for the array one because it looked logical (I want to listen for packet 0x00 of the PLAY protocol) and not too ugly (if check) nor too verbose (specially named packet).