Skip to content

Fix Shift + right click with mending gives mass xp- Fixes #1694#1710

Merged
granny merged 1 commit into
PurpurMC:ver/1.21.10from
madebytwentyfive:fix/shift-right-click-mending
Oct 24, 2025
Merged

Fix Shift + right click with mending gives mass xp- Fixes #1694#1710
granny merged 1 commit into
PurpurMC:ver/1.21.10from
madebytwentyfive:fix/shift-right-click-mending

Conversation

@madebytwentyfive

Copy link
Copy Markdown
Contributor

Issue is well explained here. See #1694

Minecraft Mending

As explained in the wiki:

  • Experience in the orb is deducted by one point for every two durability points repaired. For example, one durability point repaired doesn't take any experience away from the orb.
  • I tested this and I found out that it's correct, my item does get repaired when its damage equals 1 without any xp.

What the patch does

  • If the item damage equals 1, it removes 2 exp, else the points value.
  • But the issue, is that it spawns an exp orb of points value.
  • This results in, if you shift + right click when the damage is 1, you get the item repaired and you also get points to your xp (This explains why in the issue, it would give you mass xp when the item is not damaged).

My solution

  • If the damage is 1, we remove 2 xp points as the patch did (Still the same)

  • But instead of creating an exp orb of points value when damage is 1, we make it an exp orb of 1 point.

  • This will resolve into the player losing 1 point to repair the 1 damage.

  • If it's more than 1 damage, it's the same as the patch did.

(I didn't make an exp orb of 2 points, because this would mean, you won't lose any xp to repair your item, which people can use as an exploit to have an unbreakable item e.g. Mining blocks with shift + right click + left click

  • If this is not well explained enough, put a comment here.
  • I tested all this and it works as intended.

@madebytwentyfive madebytwentyfive changed the title Add only 1 xp point when item damage = 1 - Fixes #1694 Fix Shift + right click with mending gives mass xp- Fixes #1694 Oct 24, 2025

@granny granny left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for your help tackling these longstanding issues :)

@granny granny merged commit b66c0af into PurpurMC:ver/1.21.10 Oct 24, 2025
1 check passed
@madebytwentyfive madebytwentyfive deleted the fix/shift-right-click-mending branch October 24, 2025 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Players gain infinite xp from shift-right-click-repairs-mending-points with a tool at full durability

2 participants