[SPIGOT-4387] Item durability loops and is subtracted from items that fire BlockPlaceEvent Created: 20/Sep/18  Updated: 22/Dec/18  Resolved: 22/Dec/18

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: RoboMWM Assignee: Unassigned
Resolution: Fixed Votes: 1
Labels: None

Version: git-Spigot-6b015b4-79ada74 (MC: 1.13.1)
Guidelines Read: Yes

 Description   

To reproduce:

In a plugin: cancel all BlockPlaceEvent events.

  1. Give yourself an item (hoe, axe)
  2. Use the item's right click on a valid block (grass/dirt for hoes, logs for axe, etc.)
  3. Observe that the item's durability has decreased.

The durability also "loops," such that an item with 1 use left (249/250 durability) will be restored to full durability.

  1. /minecraft:give @p minecraft:iron_axe{Damage:249}
  2. Right-click log with axe.
  3. Observe that item now has full durability.

Initially reported at https://github.com/TechFortress/GriefPrevention/issues/355



 Comments   
Comment by Senmori [ 28/Sep/18 ]

Ok, so I have a fix (not pushed yet) that fixes the issue. However, all it does is not let damageable items fire BlockPlaceEvents.
And so the PR is not completely useless, it adds a way to grab the interactions this issue talks about (e.g. axes stripping logs, hoes creating farmland, etc).

Comment by Senmori [ 28/Sep/18 ]

Yes, if you use an axe with 1 durability left and cancel the BlockPlaceEvent it will loop back to full durability.

Comment by md_5 [ 28/Sep/18 ]

Also doesn't fix the ticket - durability looping?

Comment by Senmori [ 27/Sep/18 ]

Just want to update this report:
I currently have a PR open for this.
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/pull-requests/495/overview

However, it does not fix certain tools firing the BlockPlaceEvent due to how the BlockPlaceEvent is called. I also did not want to change that because of the possibility of interfering with the BlockPlaceEvent firing.

Comment by Senmori [ 21/Sep/18 ]

Can confirm this bug exists. I'm working on it.

Comment by md_5 [ 21/Sep/18 ]

Why is a hoe firing a blockplaceevent o.o

Generated at Tue Apr 22 04:30:18 UTC 2025 using Jira 10.3.5#10030005-sha1:190c783f2bd6c69cd5accdb70f97e48812a78d14.