So today I came home early and my cat was being nice to me. He was hanging round me and even letting me stroke him (he'll move his head to where he wants to be stroked). Then when I went out of the room and was zipping up my backpack (had come home from college) he randomly attacked me and put his claws into my shoulder. Normally when he doesn't like something, he just gives me a tap of his paw without claws. However this seemed to have no cause other than the fact I wasn't feeding him (it was 2 hours away from his feeding time yet he was meowing, presumably because he thought it was already that time since I came home). I read it up and it sounds like play aggression, so I went to go and play with him with my dressing gown robe (his proper cat toys broke and he's been fine playing with the dressing gown robe) and he sure was attacking it. Now that I know what it was, how do I teach him not to attack me (or how to show when he's playful) as it's kinda painful when he does [laughing emoji]. It's not the first time he's done it either. He could be purring and then suddenly attacking me. There seems to be no pattern, other than the two ways to tell are his eyes go green and he looks like he's about to pounce (neither of which he showed today).