What happens if `p` isn't a MCPlayer? You'll get a NPE. I believe other functions show how to get the player better.