Skip to content

Add API to Read/Write Schematic Metadata #3534

Description

@Chaoscaot

What feature do you want to see added?

This extension would enable a plugin to write to the metadata of a schematic, when it is saved via the plugin.

Use case:
Writing custom metadata to a Schematic would enable plugins to store external data (not in the world) in schematics.
e.g. Which player created the Schematc or plugin locations, like a particle spawner.

API:
My proposal would be to add the following methods to the FastSchematicWrite:

public void setMetadata(CompoundTag);

This CompoundTag would be written as the Metadata in the Schematic, properties like the Date or WorldEdit origin would be overwritten before writing it to the Schematic.

In the FastSchematicReader there would be:

public CompoundTag getMetadata();

This returns the metadataCompoundTag already read in the read function.

Are there any alternatives?

Writing metadata to the schematic can already be achieved by extending the schematic writer and overwriting the writeMetadata function.
Reading requires a double parsing of the schematic to extract the metadata.

Anything else?

I'd love to implement this myself, just wanted to open this issue first, to find out if this has a chance at merging.

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions