ran into problems creating Player.getXPosition()

there's an error that occurs when I try to run it, but I run into this
error. Clearly it's a public function but when i try calling it in
PlayState, it refuses.