Sporesteel · Ep 5Minecraft 26.3

How to Make Self-Repairing Gear in Minecraft 26.3 (Fabric)

This is the episode the whole series has been building to. Sporesteel is living metal: damaged tools and armor slowly grow back, and they grow back faster in dark, damp places, just like the fungus they came from.

What you need: the Sporesteel project from episode 4, Minecraft 26.3, Fabric Loader 0.20.1, Fabric API 0.165.2+26.3 and Java 25.

How the repair works

Every few seconds, each damaged Sporesteel item a player carries or wears regains a point of durability. The base speed is slow; darkness and water each speed it up.

Ticking items in the inventory

Dark and damp

Showing it to the player

A tooltip line tells players the gear is alive, and a few spore particles show it healing.

Recap

Sporesteel gear now heals itself, faster underground near water. Next episode we polish the mod and publish it to CurseForge.

Frequently asked questions

How do you make an item repair itself in Minecraft?

Run code regularly for items in a player's inventory and lower their damage value with setDamageValue while they are damaged.

How do you check if a player is in a dark place?

Read the light level at the player's position from the level and compare it to a threshold.

How do you check for rain or water near the player?

Use level.isRainingAt(pos) for rain and isInWater() on the entity, or scan nearby blocks for water.

How do you add a tooltip to a modded item?

Add a tooltip line to the item with translatable text so it can be localized.