The problem with this is the dying animation of the NPC, if there's multiple NPCs and no item exists on the ground until the dying animation is complete.
myPlayer().isUnderAttack() resolves to false when NPC is dead, but has not completed dying animation, which means there's no item on the ground and bones != null will be false.
myPlayer().getInteracting() == null will also be true when the NPC is dead, but has not completed animation.
Therefore is there's another NPC near by they will go on to attack that NPC as monster != null && monster.interact("Attack") is true.
I also tried .exists(), isVisible() etc. but all have the same result, so the only option I've found is timer to allow for NPC to complete dying animation.