Im not familiar with reflections but i tried to replace the field without success:
private void setMaxDefenseValue() throws NoSuchFieldException, SecurityException, IllegalAccessException {
Class<SharedMonsterAttributes> attributesArmor = SharedMonsterAttributes.class;
Field fieldArmor = attributesArmor.getField("ARMOR");
IAttribute attribute = (new RangedAttribute((IAttribute)null, "generic.armor", 0.0D, 0.0D, 1024.0D)).setShouldWatch(true);
Object armor = fieldArmor.get(attribute);
fieldArmor.set(attribute, armor);
}
I called this in the constructor of my mod. Totally not sure this is the not correct way