Skip to content

Fix structure identifiers to use namespace:identifier format#454

Merged
DaanV2 merged 3 commits intomainfrom
copilot/fix-structure-identifier-namespace
Apr 21, 2026
Merged

Fix structure identifiers to use namespace:identifier format#454
DaanV2 merged 3 commits intomainfrom
copilot/fix-structure-identifier-namespace

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 21, 2026

Structure identifiers were generated as slash-separated paths (e.g. "puff/coin1") instead of the Minecraft Bedrock namespace:identifier format (e.g. puff:coin1). This caused correct usage to error and completions to suggest invalid identifiers.

ID generation (process.ts)

The first folder segment after structures/ is now the namespace; the remainder is the identifier. Files directly in structures/ fall back to the mystructure namespace.

File path Old ID New ID
structures/house.mcstructure house mystructure:house
structures/puff/coin1.mcstructure "puff/coin1" puff:coin1
structures/stuff/towers/diamond.mcstructure "stuff/towers/diamond" stuff:towers/diamond

Diagnosis (diagnose.ts)

Removed the slash↔colon translation logic that was converting namespace:identifier input into the wrong lookup key, and the spurious "needs quotes" error for slash-containing IDs. Lookup is now a direct match against the stored namespace:identifier.

Copilot AI linked an issue Apr 21, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix structure identifiers to include namespace Fix structure identifiers to use namespace:identifier format Apr 21, 2026
Copilot AI requested a review from DaanV2 April 21, 2026 06:44
@DaanV2 DaanV2 marked this pull request as ready for review April 21, 2026 06:53
@DaanV2 DaanV2 enabled auto-merge (squash) April 21, 2026 06:54
@DaanV2 DaanV2 disabled auto-merge April 21, 2026 07:29
@DaanV2 DaanV2 merged commit 4f2688c into main Apr 21, 2026
4 checks passed
@DaanV2 DaanV2 deleted the copilot/fix-structure-identifier-namespace branch April 21, 2026 09:00
@tryashtar
Copy link
Copy Markdown

tryashtar commented Apr 22, 2026

@DaanV2 This change seems to have broken quoted structure identifiers. Due to MCPE-99757, structure identifiers with slashes must be quoted. Previously the language server checked for this specifically, and accepted quoted identifiers. Now it rejects them, and autocomplete suggests unquoted identifiers.

@DaanV2
Copy link
Copy Markdown
Contributor

DaanV2 commented Apr 22, 2026

@tryashtar Is there any documentation on this? I hate this back and forwards that keeps happening 😅

@tryashtar
Copy link
Copy Markdown

The only thing I'm aware of is this:

https://github.com/Mojang/bedrock-samples/blob/main/metadata/command_modules/mojang-commands.json

The parsers for each argument are listed. /function's is called PATHCOMMAND and /structure's is called ID. That still doesn't tell you exactly how they're implemented (how they handle quoting), but that does reduce the in-game testing work that's required to merely testing every argument type, since the command tree and types are available.

@DaanV2
Copy link
Copy Markdown
Contributor

DaanV2 commented Apr 23, 2026

@tryashtar I have an update here:

#456

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Structure identifiers are wrong

3 participants