Good start, but one thing I've noticed already:
Entity kharid = closestAttackableNPCForName("WARRIOR");
In this line, you're literally searching for an NPC called "WARRIOR". You need to remove the quotation marks from around WARRIOR so that line of code will reference your WARRIOR variable and search for the string "Al-Kharid warrior" .