tModLoader Item Qualities and Durability

Not bad, but a few things to note:
  1. Repair-specific hammers exist in the base mod to add a cost to repairs. If any old wood hammer can now do this, it's as if the durability system doesn't exist except as a minor inconvenience (with the exception of the max durability loss mechanic I added).
  2. Your formulas are specific about relying on weapon stats, but these have some flaws (as you noticed with vortex beater and sniper rifle). My system currently scales durability loss amounts with use time, and sets the item's total durability amount based on its sell value. Assuming mod makers and terraria devs aren't mislabeling item values, these metrics are (generally) pretty sound.
  3. I'm not terribly picky about licenses, but I did include one that asks for forks or derivative works to be similarly open sourced. On that note, git/github has functions for forking code, which become very useful for projects like these (along with version control in general; git only being but one type)!
1: The amount hammers can repair is completely configurable. You'll burn through resources making more and more with a normal, non hoarding playthrough. Maybe 2x default is a little much though.

2: I don't really trust the value because of mods either undervaluing or overvaluing items, hence why I went for stats instead. It still works out fine and I prefer it this way. Adding a few manual tweaks doesn't really bother me much.

3: Whoops, I must have forgotten to mark the mod as decompileable. I'm a big stranger to Github and the like, so I never really used it.

Edit: Updated with a decompileable version.
Last edited:
I just found a bug regarding the inventory and one of the weapons of the WeaponOut mod (Specifically the Raiden Sword).

Inventory Bug 1.PNG
Inventory Bug 2.PNG
Inventory Bug 3.PNG

The bug messes my inventory up and anytime i try to throw the weapon away in the trash slot, my inventory disappears.

This only seems to happen when i add the durability mod. I removed this mod and the problem went away but as soon as i installed it again, the problem came back.
Last edited:
Well, there was bound to be something that'd break. I'll take a look and see what's causing this problem. It's most likely a divide by 0 error.

Edit: Fixed. It was caused by the weapon having a useTime of 0. Now on, if useTime is 0, it'll use useAnimation instead.
Last edited:
Would you generally consider this to be compatible with content mods? (WeaponOut, Thorium, Spirit, etc)
It looks really neat and I want to try it out. :D
Top Bottom