I was trying to figure out how to correctly do AttributeModifiers, but in the process I accidentally set Operation to 3, which isn't a valid Operation. Just having the item in my inventory caused the game to crash. I kept having to delete the item using NBTExplorer in order to load the world again without crashing. I eventually realized my mistake and set Operation to 1.
Here's the command I used: