Disabling Attacking

I'd like to be able to prevent the player from attacking mobs without having weapons overwrite it. If I change the player's base attributes, holding an item with an attack attribute allows the player to attack again. Is there a way around this, or a different way to prevent a player from hitting entities?
Continue to help post