How to deal with large amount of spawned actors?

I made a short code that spawns blocks in a cube by given dimensions. Everything works fine, but,
when the amount of blocks is going big (for example 100x100x1 which is 10k blocks), my whole computer freezes. If any of you played Minecraft, should know that it’s world is made of really bigger amount of blocks. My blocks don’t even tick. Textures or shapes doesn’t matter. What can I do to make this works? (I want to make Minecraft-like world)