gnembon / fabric-carpet

Fabric Carpet
MIT License
1.72k stars 275 forks source link

scarpet: 'biome' argument type does not autocomplete #725

Open fghsgh opened 3 years ago

fghsgh commented 3 years ago

The following is a simple Scarpet script:

__config() -> {
  'commands' -> {
    '<biome>' -> _() -> null
  },
  'arguments' -> {
    'biome' -> {
      'type' -> 'biome'
    }
  }
}

It implements a single command /command <biome> which does nothing (obviously it would do something more useful in an actual application). Now, the problem here is, usually with Brigadier commands, even Scarpet-defined ones, there is TAB autocompletion. This is extremely useful if only for seeing a list of possible options that can be passed. As the list of biomes is generally not well-known by most players, it would make sense for this argument type, 'biome', to also support autocompletion, especially as similar vanilla scarpet argument types already do support it.

Vanilla also supports biome autocompletion, by the way. It works correctly on /locatebiome, which presumably takes the same argument type as is being defined here.

James103 commented 3 years ago

Have you tried running this in the latest Carpet mod version?

fghsgh commented 3 years ago

Yes. Just confirmed it also happens in 1.4.27.

James103 commented 3 years ago

I can also confirm this with Carpet mod 1.4.45 and Minecraft 1.17.1. As far as I can tell, the biome argument type falls back to term when used in Scarpet-defined custom commands.