Forgotten Graves

Forgotten Graves

273k Downloads

[FEATURE] Configurable Item Decay

ginsm opened this issue ยท 2 comments

commented

Describe the feature you would like to see.

I feel like as the grave decays so should item durability, but not to the point it breaks, but to the point of near broken after a long period of time.

Suggested by theliteraldeath on CurseForge [c].

commented

Commit 070473c closes this issue:

Configurable item decay allows the user to set a max decay percent
value.

Every time a grave ages it will attempt to decay items by a configurable
amount (maxDecayPercent). Setting maxDecayPercent to 0 will disable
this functionality.

The amount it decays is affected by how decayed the item already is;
the more decayed it is the quicker it'll decay. In addition, the chance that the
item actually decays is affected by the Unbreaking enchantment.

[ Practical Example ]

Take for example a diamond sword with 61/1561 durability (96.1% used
up) and a maxDecayPercent of 80. The algorithm will use 96.1% of the
maxDecayPercent (76.8% in this case) to damage the item.

In this case, 61 (remaining durability) * .768 = 47 durability (rounded up).
This would leave the sword at 14/1561.

If the sword were at 1500/1561 durability it would damage it by 3.9% of
the maxDecayPercent; the sword would suffer 3.12% durability damage and
end up at 1453/1561.

I made a quick calculator to toy around with and find a desired amount of decay.

commented

I'm going to be adding this in the next update as a config option (itemDecay) that is disabled by default. A few things to note:

  • The config option will take an integer that represents the max percentage an item can decay each time its grave ages.
  • Items that are more worn will decay quicker than their less worn counterparts; perhaps unbreaking will come into play?
  • If itemDecay is set to 0 the option will be disabled entirely.