Structure Protection is a Fabric mod for Minecraft that stops players from breaking, exploding, or transforming blocks that were actually placed during structure generation — nothing more, nothing less. It works on both client and server: install it on a dedicated server to protect the world for everyone, or in singleplayer for the same protection locally. The optional Mod Menu screen adds a client-side configuration UI, but isn't required to use the mod.
Instead of protecting a structure's whole bounding box (which would also lock up caves, terrain, and anything built nearby), Structure Protection tags each individual block placed by StructureStart.placeInChunk with the ID of the structure that generated it. A player-placed block sitting right next to a Bastion looks the same but isn't protected — only the Bastion's own blackstone is.
Structures generated before installing this mod can't be retroactively identified at the block level.
Known Issues:
Villagers cannot pick the crops in villages when they are protected.