This is just an example, you can customize this if you want, also just change the name of the mob and the structure on the structure block together with the names on the command, with that you can create another structure that you can spawn.
first make sure you rename the spawn egg you're using it else it won't work.
I'm using bat because they're useless mobs, they're small and they don't drop anything when they die.
copy them exactly like that
This is another example
First command: execute at @e [name="HOUSE 01"] positioned ~ ~ ~ run structure load "HOUSE 01" ~ ~ ~
Second Command: This is the chain command block.
kill @e [name="HOUSE 01"]
the additional command that not necessarily needed.
effect @e [name="HOUSE 01"] invisibility 1 1 true
this command is suggested if you don't want a command always pop up on your screen.
gamerule commandblockoutput false
![](https://s2.save4k.ru/pic/6KtdOcS2JYM/maxresdefault.jpg)