Modifier Name Cannot Be Empty

java.lang.IllegalArgumentException: Modifier name cannot be empty
This crash is caused by mousing over an item or holding it with an attribute that has no UUID.

How to fix this

Note: You will lose everything in your inventory; it isĀ advisableĀ items in a chest to prevent them from being deleted!
If the item is in a container (such as a chest, dispenser, hopper, etc.):

  1. Make sure you are not currently selecting the first empty slot in the hotbar
  2. Break the chest
  3. Be sure not to select the item in the hotbar or mouse over it in the inventory (if you hold it in the hotbar accidentally, follow the second set of instructions)
  4. Type /clear @p into the chat
  5. If it works, you are done. If the chat says you don't have permission to use that command, keep following these instructions
  6. Press Esc to bring up the pause menu
  7. Click "Open to LAN"
  8. Click the "Allow Cheats: OFF" button until it says "Allow Cheats: ON"
  9. Click "Start LAN World"
  10. Type /clear @p into the chat again

If the item is in your inventory

  1. If your world is open, save and quit to the title screen
  2. You will need an NBT editor, such as NBTExplorer
  3. Open your minecraft folder
  4. Open the folder of the world the item is in
  5. Open level.dat in the NBT editor
  6. Go into the Data item, then Player
  7. Delete the Inventory item (usually by selecting it and clicking the delete button at the top)
  8. Save the file (Ctrl+S or Cmd+S on OS X)
  9. Close the NBT editor and reenter your world

How to avoid the crash

Instructions on correctly creating items with attributes. Requires knowledge of MCEdit. It is possible to edit the world's NBT directly, but it is far easier to do and much harder to mess up in MCEdit, so these are MCEdit instructions.
  1. First, you will need MCEdit and the AddAttribute filter
  2. Open your world in Minecraft and create a chest with the item (to which you want to add the attribute(s)) in it
  3. Save and quit the world
  4. Open MCEdit
  5. Click "Load World...", select the world you want to edit, and then click "Load"
  6. Select the chest
  7. Click on the "Filter" button in the hotbar and select the "Add Attribute Modifier" filter
  8. Choose the attribute settings you want, and be sure to put some number (pick something between 1 and 1000) in the "Label" field
  9. Click "Filter" at the bottom of the dialog box and wait for MCEdit to finish running the filter
  10. Save and Quit MCEdit