How to spawn a structure from NBT structure file?

Sponge Build: 7.1.0
Forge Build: (Ignore if using SpongeVanilla)
Java Version: 1.8.0_191

Plugin Source: creating a git repository

Hi guys!

Back again to struggle with my battle royal plugin. I was recently wondering how to save structures into files and I just discovered a vanilla behavior with the structure block. If I understood well, it saves a defined region into a NBT file.

Knowing this, I’m just wondering if they’re is a native way to spawn a structure from its NBT file with the Sponge API or do I have to implement a builder class that would parse the file and place manually each blocks ?

Thanks to share your knowledges :wink:

PS: Sorry for the inconvenience of my poor English… Hope you understand it well.

1 Like

The structure block is not a recommended way of interacting with loading/saving structures; the format is supported only by the structure block itself. If you wish to load or save regions, you should use the Schematic API, DataTranslators.SCHEMATIC, and DataFormats.NBT.

1 Like