Skip to content

feat(command): identifier parsing & argument type#2000

Open
Laptop59 wants to merge 2 commits intoPumpkin-MC:masterfrom
Laptop59:identifier_argument_type
Open

feat(command): identifier parsing & argument type#2000
Laptop59 wants to merge 2 commits intoPumpkin-MC:masterfrom
Laptop59:identifier_argument_type

Conversation

@Laptop59
Copy link
Copy Markdown
Contributor

@Laptop59 Laptop59 commented Apr 10, 2026

Description

This PR aims to create an argument type IdentifierArgumentType that can parse identifiers.
However, since we don't actually have a structure with namespace and path separated, this PR also adds an new struct Identifier in pumpkin-util.

Identifier consists of both a namespace and a path, each stored as a Cow<'static, str>. Not for registries, but for identifying user-generated content (like bossbars) which cannot be fully represented by &'static strs.

We need an argument type for this as commands like /bossbar, /random, and /waypoint take an identifier which is user-generated and not associated with any registry.

Maybe if we want to parse item IDs later for example in a new argument type, we can first parse an Identifier using from_reader and then check if an item under that identifier does exist.

Testing

Added new tests for creating and parsing Identifiers, and they all pass.

@Laptop59 Laptop59 marked this pull request as draft April 10, 2026 07:57
@Q2297045667 Q2297045667 added the command Anything command or chat-related label Apr 10, 2026
@Laptop59 Laptop59 marked this pull request as ready for review April 10, 2026 11:34
@Laptop59 Laptop59 changed the title feat(command): identifier argument type feat(command): identifier parsing & argument type Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

command Anything command or chat-related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants