If the server properties for pvp are false, the entity damage event will not work for pvp. If you turn it to true it does work. Is there a way to use this when the server properties say pvp is false?
Use a PlayerAnimationEvent, check for LEFT_CLICK_ENTITY, damage the NPC if the event was directed at them. That's sort of hacky, there must be a way to override the server PVP toggle.