Yeah, pretty sure that's a bug with shields in particular. I tried doing pretty much exactly that in my Advanced Addons mod, and the "blocking" model would never work, no matter what I tried. To make matters worse, the shield functionality isn't even exposed, so I had to use an event handler to mimic the blocking damage to the shield. Shields are not too easy to extend!
I solved my problem. I had to iterate over all the active log4j loggers like so:
LoggerContext ctx = (LoggerContext)LogManager.getContext(false);
Collection<LoggerConfig> lc = ctx.getConfiguration().getLoggers().values();
for(LoggerConfig c : lc) {
c.addFilter(new SpamFilter());
}
You could always wait for the item to be held in the item update method, then when the status changes, write it to the ItemStack's NBT. Then, read that NBT from the ItemStack in the hasEffect method.
I don't want it to be a static file in the jar, I want it to be configurable. Still looking into the XML format for log4j, I don't know what I'm saying.