you define both the players and npcs as entities and build a class around them
the upside so doing this is that you only need one method for attacking npcs / players etc
If you wanted to attempt something like it i'd suggest keeping the player & npc class and build an abstract entity class for them and have them extend that class.
for e.g.
Code:
public abstract class Entity
{
public abstract int getX();
public abstract int getY();
public abstract int getHeight();
}
Code:
public abstract class Player extends Entity
Code:
public void attack(Entity e) {