**This is not tested, i am just speculating. If this doesn't work, don't rage on me of giving wrong info**
You can check the side of the context you get, and if it's Side.CLIENT, you can use Minecraft.*, and if it's Side.SERVER, You can use the MessageContext you get passed in, use the
getServerHandler()
method which has a EntityPlayer object called entityPlayer that youc an use.