Command autocomplete doesn't sort strings that start with the given word to the top
The bug
The command autocomplete feature in the 1.16 snapshots now also considers parts following an underscore when searching for possible completions. However, this causes an issue when quickly typing commands.
For instance, when typing /setblock ~ ~ ~ sandston, the first result is minecraft:chiseled_red_sandstone, which is most likely not the block that should be on top and automatically selected.
This causes annoying delays when typing commands since the user needs to type the word fully (thus making the autocomplete feature superfluous) or use the arrow keys to scroll to the correct (short) word (which takes some time).
Instead, strings that do not start with the given string but have the given string following an underscore should be sorted below the strings that start with the given string.
Examples
- /setblock ~ ~ ~ dir
→ minecraft:coarse_dirt - /setblock ~ ~ ~ ston
→ minecraft:chiseled_stone_bricks - /setblock ~ ~ ~ sandston
→ minecraft:chiseled_red_sandstone - /setblock ~ ~ ~ terracott
→ minecraft:black_glazed_terracotta - /summon minecar
→ minecraft:chest_minecart
Linked Issues
Created Issue:
Command autocomplete doesn't sort strings that start with the given word to the top
The bug
The command autocomplete feature in the 1.16 snapshots now also considers parts following an underscore when searching for possible completions. However, this causes an issue when quickly typing commands.
For instance, when typing /setblock ~ ~ ~ sandston, the first result is minecraft:chiseled_red_sandstone, which is most likely not the block that should be on top and automatically selected.
This causes annoying delays when typing commands since the user needs to type the word fully (thus making the autocomplete feature superfluous) or use the arrow keys to scroll to the correct (short) word (which takes some time).
Instead, strings that do not start with the given string but have the given string following an underscore should be sorted below the strings that start with the given string.
Examples
- /setblock ~ ~ ~ dir
→ minecraft:coarse_dirt- /setblock ~ ~ ~ ston
→ minecraft:chiseled_stone_bricks- /setblock ~ ~ ~ sandston
→ minecraft:chiseled_red_sandstone- /setblock ~ ~ ~ terracott
→ minecraft:black_glazed_terracotta- /summon minecar
→ minecraft:chest_minecart
testing discovered
relates to
relates to
I discovered this while testing MC-182309.
How is this a feature request? Bugs like MC-182309 are closely related, yet they are apparently "Important". Please reopen this.
Return of MC-182309?
It was like this in 1.16 Pre-release 6 after MC-182309 was resolved, so "type=" must have not been included somehow.
I agree with user-f2760. When searching for recipes, items whose names exactly begin with the search query should appear first, and items whose names merely contain the search query should appear second. Within each of those categories, recipes should be sorted alphabetically. This is similar to how sorting for command autocomplete was solved in MC-182309.
However, the 1.20.2 pre-release 1 article mentions that it is desirable to not overwhelm new players with many recipes that they have never seen before.
To fulfill the needs of both experienced players and new players, perhaps a new option should be added to the game settings that determines whether search results can contain recipes that haven't been unlocked yet. This option could default to off so that new players wouldn't be overwhelmed by many unfamiliar recipes in search results, but experienced players could toggle the option to on. This would be similar to how the "Operator Items Tab" option was added to the "Controls" settings menu in 22w45a to allow convenience for experienced players without overwhelming new players.This will enable experienced players to find the recipes they are looking for (even if it hasn't been unlocked yet) without overwhelming new players
/give @s minecraft:comm
atocomplete: minecraft:repeating_command_block
A possible work-around for this is to use the optional namespace "minecraft:" in your commands because
MC-182624will cause command autocomplete to omit suggestions that have the word you typed after an underscore (which means that the block/item/entity/recipe that you want is first in the remaining list). However, this work-around is very limited because typing "minecraft:" probably takes longer than just completely typing the name of the block/item/entity/recipe that you want.Confirmed in 20w20b.
Confirmed in 20w21a.
Confirmed in 20w22a.
Confirmed in 1.16 Pre-release 1.
Confirmed in 1.16 Pre-release 2.
Confirmed in 1.16 Pre-release 3.