Okay, but what is the player object in that line? If you could perhaps post the line where you instantiate it, that would be great.
I tried this:
EntityPlayer player = mc.thePlayer;
player.attackEntityFrom(DamageSource.outOfWorld, 1);
In server tick handler, but that doesn't seem to work.