Skip to content

Keep a structure (.nbt) in the pack without a Structure(...) call #173

Open

Description

@ItsMeBrianD

Problem

Assets are copied into the pack based on use. A project .nbt file is copied only when some Structure(...) call names it (engine/project/unused_assets.go, lint/unused-asset). Otherwise the pack leaves it out, and the VS Code World view marks it not used.

Some structures are wanted in the pack even though no template pool references them. For example, a structure is placed with /place template or by a structure block from a function, or it is a piece kept for later work. Right now the only way to keep one is to add a dummy Structure(...) call to some pool.

Ask

Add a language construct that explicitly keeps a structure file in the pack without needing a Structure(...) call in a pool. A kept file:

  • is copied into the data pack under its id, the same way a Structure(...) use copies it
  • no longer counts as unused, either for lint/unused-asset or for the World view's "not used" status

Possible shapes (to decide)

  • A top-level declaration, such as Keep Structure("structures/old/stairs.nbt", "old/stairs"), reusing the existing call so the id and path rules stay the same.
  • A keep list in mms.json, such as "keep": ["structures/old/**"]. This needs no source edit, but it lives outside the language.
  • A general Keep that also covers Texture/Sound, since the same use-based copying applies to .png and .ogg.

The World view could then offer a "Keep in pack" action in a not-used structure's ⋯ menu.

Not being worked on yet. This came up while decluttering the World view's structures list (#172).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions