Suggestion Tweaker (Fabric/Forge)
This is a client/server mod that improves the way suggestions are filtered and sorted when writing a command.
Dependencies
This mod requires Cloth Config API. Mod Menu is optional in case you want more configuration like enabling case sensitivity and changing the filtering mode.
Improved filtering
-
Vanilla usually starts comparing the input with the start of the suggestion candidate and discards if it doesn't match. In some cases it checks for a
.
or_
and then the input. This can often be annoying when trying to search for something because it is too strict. This mod changes that, so now you have a choice between different filtering modes:STRICT
- the vanilla waySLIGHTLY LOOSE
- shows all suggestions containing the input anywhere insideLOOSE
- like the previous but with multiple words, separated by an underscoreVERY LOOSE
- shows all suggestions containing every letter in the input
-
Suggestions with a specific prefix can be hidden. That applies to both directory and file names. For example, if the specific prefix is an underscore, an identifier named
datapack:_function
will be hidden and so will bedatapack:_directory/function
butdatapack:directory/function
won't be. It works for all identifiers, not just functions. This feature is disabled by default.
Improved sorting
Suggestions are sorted from the strictest to most loose match. Vanilla only sorts alphabetically, lacking multiple filtering modes.
Server and client
Suggestions can be separated into two groups:
- ones that are filtered on the server(based on the client's input);
- e.g. functions, loot tables, item modifiers, predicates, and a few others
- ones that are filtered on the client.
- e.g. scoreboard criteria, colors, blocks, and others
Since the first group's filtering is controlled by the server, a special workaround is established to let the client use the new way of filtering suggestions, independent of the server. Therefore, this mod is also a server mod and provides better suggestions even for clients without the mod.
Examples
Top - vanilla, bottom - Suggestion Tweaker.
Idea
Credit goes to SnaveSutit for the cool idea!