Question: how to make a command block build a castle?
Answer: First, you need to program the command block with a /summon command that will be used to build the castle. This /summon command will be run when the command block is activated. So, stand in front of the command block with your pointer (the plus sign) on the command block and click on the right mouse button.