mojira.dev
MC-271636

Attempting to modify NBT of killer rabbit throws unexpected error

When trying to use the command below, the error message "An unexpected error occurred trying to execute that command" appears in chat.

data merge entity @e[nbt={RabbitType:99},limit=1] {DeathLootTable:"air"}

However, you can summon a rabbit entity with any DeathLootTable.

summon rabbit ~ ~ ~ {DeathLootTable:"air",RabbitType:99}
[media]

 
Tested in 1.20.6 and it works perfectly, so only the latest snapshot seems affected.

Attachments

Comments 1

I can confirm, but I edited the report a bit since it's not about loot tables specifically; any change to the data triggers this.
It's unclear exactly what the issue is since the error doesn't appear to get logged, but I'm pretty sure from poking at the code that changing NBT calls setVariant again, which applies an attribute modifier for evil rabbits. Since it was already applied earlier, the IllegalArgumentException in AttributeInstance.addModifier gets thrown. This wasn't an issue in 1.20.6 since the killer rabbit didn't use attributes for its extra damage.

migrated

gegy

Confirmed

Platform

Important

Commands

24w18a

24w20a

Retrieved