how can i make so game will check mob if it is player or another mob(like NPC). i need it because for some reason i get error with my health bar when i hit it with spell and i think that i can fix it with that command(or something else). i think it should be something like this if(mob==player). any ideas?
NPCs are non-player characters. They won't have a client, so you can check for that.
In response to Kaiochao
Note that it may be better to check the key variable. A mob will only have a client if somebody is logged on, but a mob left behind after somebody logs off will still have a key. This is important if you want to - for example - prevent people from logging off during combat to escape death. You can't literally stop them from closing their game, but you CAN leave their mob behind for some duration before deleting it, in which case client will be null but key will still have a value.