• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

Buff that repairs blocks in a certain radius?

I'm looking to create a block that will slowly repair blocks around it. Creating a custom block is easy, but is it possible to create a buff that can "heal" blocks?  I do not see an existing buff that does this, so I am not sure that it is possible.

 
You would likely need to create a custom block functionality via a C# mod and hook your custom-defined block into it. I would look at SphereII's SCore or a similar mod for examples of how to implement blocks with custom functionality.

For the actual repair code, I would probably do something like:

  1. Build and maintain an affected blocklist (mimic a landclaim block?)
  2. Schedule repair updates (mimic a growing plant block?)
  3. Repair affected blocks (mimic ItemActionRepair?)
 
My plan was to modify the LCB to do a periodic tick to repair blocks in the claim over time. When you have a large base it begins to become impossible to repair things between hordes. The other idea is a way to SEE damaged blocks. A piece of eyewear that highlights any block with less than full health in red so I can repair them and get on with life.

 
There's an old A19/20 mod, "Claim Auto-Repair Block" that has very similar functionality:  https://7daystodiemods.com/claim-auto-repair-block/

Not sure if it still works in A21 (would depend on if the existing code can recognize the new blocks or not, I guess), but even if it's broken there may be some ideas in there so that you don't have to reinvent the wheel.

EDIT: According to the relevant forum topic on here, the dev has quietly updated the mod for A21.





 
Last edited by a moderator:
Back
Top