mojira.dev
MC-312332

Autocomplete for `/gamerule` does not consider parts after an underscore

Compared to for example the /give command, the /gamerule command has too strict suggestion matching logic. In particular, the /give command first splits up the suggestions by _, and then matches each part individually. If any of the parts match, the entire string will be suggested. The /gamerule command does not split up the suggestions, which means the entire string must match. This is inconsistent, but more importantly this makes it significantly harder to find game rules when compared to items.

Consider a concrete example:

  1. Type /gamerule time.

  2. Observe that the game rule advance_time IS NOT suggested.

  3. Type /give @s apple.

  4. Observe that golden_apple IS suggested.

Another example is that you cannot find max_entity_cramming when typing cramming.

Both should use the same, lenient matching strategy. Currently the /gamerule command uses a worse suggestion strategy, which hurts accessibility.

I can confirm this in the game’s code as well. Items use net.minecraft.commands.SharedSuggestionProvider, while game rules rely on Brigadier’s limited suggestion logic (com.mojang.brigadier.tree.LiteralCommandNode#listSuggestions).

Linked issues

Comments 1

Can confirm. Fixing MC-309236 may fix this.

Also adding attribute <target> <attribute> modifier add <id> <value> to the report since that was the only other instance of not considering parts after an underscore that I was able to find actually I will create a new report for this since they could likely be fixed separately. (Edit: made MC-312339.)

Frederik van der Els

(Unassigned)

Confirmed

26.3, 26.4 Snapshot 2

Retrieved