Need help adding thousands of item to the build menu through code

You can write a code that does this, then save your scene with this code at the end, then use the output file instead of the current scene:


var scene = PackedScene.new()

scene.pack($".")

ResourceSaver.save(scene, "res://NewScene.tscn")

Also you can use get_node(“path/to/node”) instead $“.” for save a node with its children