mojira.dev
MC-112850

Items with empty AttributeModifier tag spam console

When the player has an item with empty AttributeModifiers in their hand, the console is repeatedly spammed with the message

"Unable to create attribute: Modifier name cannot be empty."

To test:

  1. Use this command:

    /give @p diamond_hoe 1 0 {AttributeModifiers:[{}]}

    or

    /give @p diamond_hoe{AttributeModifiers:[{}]} 1
  2. Check console

Attachments

Comments 4

It looks like you have to hold the item in your hand (main- oder offhand) or wear it as armor.
This can be easily reproduced by hovering over them item as well.

Expected behavior would probably be that the method net.minecraft.item.ItemStack.getAttributeModifiers(EntityEquipmentSlot) removes the invalid attribute.

The console spam seems to have stopped (just checked in 18w50a) but I'm not sure if there's perhaps some other syntax you could do to trigger it again. Potentially fixed

I would say this bug is fixed since 18w50a. Tested again in 1.15 pre-2 to double check and no issues.

onnowhere

(Unassigned)

Confirmed

AttributeModifiers, attribute, item, logging

Minecraft 1.11.2, Minecraft 17w15a, Minecraft 17w16a, Minecraft 1.12 Pre-Release 2, Minecraft 1.12, Minecraft 17w48a, Minecraft 17w49b

1.15 Pre-Release 2

Retrieved