mojira.dev
MC-269595

Summoning a large EXP orb damages mending items to negative durability or 0 durability

I was playing a world, and was experimenting with summoning large EXP orbs.

Note

It seems that in Snapshot 23w51a, a sub-bug was fixed in which the durability bar would not go outside the screen to the left
In Snapshot 24w10a, this bug no longer makes the durability ~ -63000, instead, it makes the durability 0

Expected:

Tools would mend

What Happened:
Tools went into the extreme negatives of the durability or 0 durability

Reproduce:
Video:
https://www.dropbox.com/scl/fi/u85c0455v409euxfbuy6t/bug.mov?rlkey=jhgpaju9yj3ppvz9ns238negd&dl=0
 
Run these commands and steps:
1.

1.20.4 and older (old NBT tag system)

/item replace entity @s weapon.mainhand with diamond_pickaxe{Damage:1.Enchantments:[{id:mending,lvl:1}]}

1.20.5 and up (new component system)

/item replace entity @s weapon.mainhand with diamond_pickaxe[damage=1,enchantments={levels:{mending:1}}]

2.

This only works (breaks) if the item is in your off-hand or the SelectedItem slot.

/summon experience_orb ~ ~ ~ {Value:32768} // Must be bigger or equal to 32768

Linked issues

Attachments

Comments 11

Can Confirm in 24w12a

 This has been a bug ever since mending was introduced, in 15w42a, a 1.9 snapshot.

This also exists in snapshot 24w13a

Isn't this because the max experience orb size is 32767, so you're therefore overflowing them?

1 more comments

hmm interesting...

does this effect the cheat command /experience?

of course I gave my self exp 365 levels of it or so before I had any gear at the beginning of a new v1.20.4 world.

This doesn't affect /xp or /experience, because those commands don't actually summon an experience orb, they just set the value in the player file to something different based on what you put in. The mending tool only repairs when a orb is picked up, not adjusting the value.

ooh ok so its not effecting me then ok thx for the info.

Affects all versions from 15w42a to latest snapshot/release

Seems to be resolved in 1.21.4, unless I'm doing it wrong. Tried XP orbs with both large ints and negative values. They have no effect, just as if I wasn't holding a mending tool.

Crypticverse

(Unassigned)

Confirmed

Platform

Low

Commands, Enchantments, Items

commands, durability, elytra, experiece-orb, mending, tool

1.20.4, 24w11a, 24w12a, 24w13a, 24w14a, ..., 1.21 Pre-Release 1, 1.21 Pre-Release 2, 1.21 Pre-Release 3, 1.21, 1.21 Release Candidate 1

Retrieved