Problem
The Custom Command API does not support overloads. Each command only allows one flat set of `mandatoryParameters` and `optionalParameters`, making it impossible to define subcommands with different parameter types under the same command name.
For example, a clan system needs:
- `/space:clan create <clanName>` → String
- `/space:clan invite <player>` → PlayerSelector
But this is currently not possible.
Workarounds (all have drawbacks)
1. Split into separate commands (`kw:clan-create`, `kw:clan-invite`) — breaks UX.
2. Use Enum + String — loses `PlayerSelector` benefits (autocomplete, validation).
Request
Add overload support to `CustomCommand`, so each overload can have its own independent parameter list — similar to how vanilla commands work.
ts
overloads: [
{ mandatoryParameters: [{ type: Enum, name: "space:create" }, { type: String, name: "clanName" }] },
{ mandatoryParameters: [{ type: Enum, name: "space:invite" }, { type: PlayerSelector, name: "target" }] }
]
This would significantly improve addon developer experience.
Please sign in to leave a comment.
0 Comments