Loading...
Beta Modpages Unclaimed

Smart Completion

Provides better suggestions to complete commands

0 Likes
2503 Downloads
Created by endor8

Description

Smart Completion

Because typing is too much effort

Minecraft: 1.16 - 1.21.11 NeoForge Fabric Environment: Client (not needed in the server) GitHub Join the Discord

📖 About

Client-side mod that provides better autocompletion suggestions for commands.

Supports modded and custom commands from datapacks or server plugins, and it's not required on the server to work.

💡 Usage

In order to type a command/argument made up of several words, type only a few initials of its words.

For example, if you want to type /gamerule doDaylightCycle true, you could type /gr dc t

/gamerule doDaylightCycle false

Keyboard Shortcuts

In addition of <Tab>, you may also use <Ctrl>+<Space> to accept suggestions, which automatically inserts a space so you can start typing the next argument.

Additionally, if the current command is known to be incomplete (your text is in red), pressing <Enter> will accept the selected suggestion, if any, rather than attempting to execute an invalid command.

By default, accepting a suggestion with <Ctrl>+<Space> or by using the middle button to click it will also erase the remaining text after the cursor, if you decide to edit an earlier argument at some point. This behavior can be configured per key/mouse button.

🔀 Disambiguating Suggestions

To disambiguate between suggestions, you may need to type more than one letter per word.

For example, to type fireDamage instead of fallDamage, which appears first when typing fd, you may type fid.

fallDamage/fireDamage

In general, it's way faster to type a few more letters to get the suggestion you want in front of the list rather than using the arrows/cycling with <Tab> to select it, as typing can build muscle memory.

Over time you will become used to the minimum number of letters you need to type the commands you frequently use, and typing them will feel like a breeze.

🔍 Browsing Suggestions

Since the words you type don't need to be at the start of the name you're typing, you may discover way more useful suggestions compared to how Minecraft suggestions usually work.

For example, if you type /give @p wood, you'll see suggestions for all items that contain a word that starts with wood.

/give @p wood

Additionally, if your query doesn't match any of the initials of a suggestion, it will also look anywhere within suggestions to provide fuzzy matches, which are listed after smart matches. This is helpful when you don't know exactly what you're looking for.

🎁 Extra Features

This mod also inverts the order of suggestions by default, so the most relevant suggestion is the closest one to the input bar and where your eyes are already looking at.

If you find this too confusing, you may disable it with the following command:

/smartcompletion invert_suggestion_order false

It also prevents the mouse from selecting suggestions as they appear under it, an old bug that makes typing commands in small windows harder than it needs to be.

✨ How does it work?

For each command you type, we ask the server for suggestions twice. Once omitting whatever you've typed for your last argument (blind query), and another including everything as a guarantee (informed query). Most of the time, only one request is sent, since we also caches requests while you type to reduce latency and blinking of the suggestions list.

Then, we work under the assumption that the server will reply with all possible suggestions to the blind query, and perform a smart filtering and sorting of the suggestions in the client side.

If there are any unexpected suggestions in the informed list that were not matched by our filtering, they'll also be shown in a different color, so you never fail to see any suggestion from potential complex commands that provide their own smart suggestions.

To filter suggestions, we use two approaches:

  • A smart match between segments of your query and the initials of parts of the suggestion (gr matches gamerule(how completion works in any code editor)
  • A weak search for each part of your query within the suggestion (lock on matches blockExplosionDropDecay) (helpful when you don't know what you're looking for)

How are words split?

We split words at any non-alphabetic character, as well as at camelCase words.

In addition, if a command cannot be split in this way, we will assume it's written in flatcase, like most Minecraft commands.

Unfortunately, unless you have a dictionary, breaking down flatcase systematically is impossible. That's why use a small dictionary of words used by Minecraft, Fabric, (Neo)Forge and WorldEdit commands to attempt to break down commands into words.

This dictionary can be overridden by resource packs (see wiki), but feel free to report any issues with words not being split correctly.

📋 How are suggestions sorted?

Suggestions are sorted according to the following criteria, whichever applies first:

  • Suggestions closer to the cursor are shown first (/give @p chest suggests [ before minecart_chest)
  • Matches of word initials are shown before fallback matches (doWeatherCycle > sendCommandFeedback)
  • Significant matches beyond some thresholds are shown first (apple > acacia_pressure_plate)
  • Matches with more initial matches are shown first (doInsomnia > disableRaids)
  • Matches where some initials could've matched more than one word are shown first (doDaylightCycle > doWeatherCycle)
  • Suggestions with less words are shown first (doInsomnia > doImmediateRespawn)
  • Matches closer to the start of the suggestion are shown first (gamemode > defaultgamemode)
  • Shorter suggestions are shown first (tp > tell)

Otherwise, the suggestions are shown in the original order provided by the server (usually alphabetic) (fallDamage > fireDamage).

Currently, there's no way to customize this order. If you have any suggestions to improve it, feel free to let me hear them. The reasoning behind these criteria is matching natural expectations, and enabling conflict disambiguation by typing more initials right away.

🎨 Customization

Suggestions are highlighted according to the styles defined in the style.json file, which can be overridden by resource packs (see wiki).

By default, matches inside a suggestion are highlighted in blue.

Alternative matches for a query part (doDaylightCycle), fallback matches (sendCommandFeedback) and unexpected server suggestions are all highlighted in dark aqua.

In addition, if a suggestion starts with a prefix of words, followed by a colon, (i.e., a resource location namespace), it will be highlighted in dark gray unless matched (minecraft:golden_apple).

Help

This mod has a wiki, which you may check out.

Also, if you're having any trouble, or maybe just want to say hello, feel free to drop by our Discord Server.

🤝 Support this project

If you want to support this project, share it with your friends!


AD Become Premium to remove Ads!

What means Verified?

  • Compatibility: The mod should be compatible with the latest version of Minecraft and be clearly labeled with its supported versions.
  • Functionality: The mod should work as advertised and not cause any game-breaking bugs or crashes.
  • Security: The mod should not contain any malicious code or attempts to steal personal information.
  • Performance: The mod should not cause a significant decrease in the game's performance, such as by causing lag or reducing frame rates.
  • Originality: The mod should be original and not a copy of someone else's work.
  • Up-to-date: The mod should be regularly updated to fix bugs, improve performance, and maintain compatibility with the latest version of Minecraft.
  • Support: The mod should have an active developer who provides support and troubleshooting assistance to users.
  • License: The mod should be released under a clear and open source license that allows others to use, modify, and redistribute the code.
  • Documentation: The mod should come with clear and detailed documentation on how to install and use it.

AD Become Premium to remove Ads!

How to Install

1

Download Forge & Java

Download Forge from the offical Site or here. If you dont have Java installed then install it now from here. After Downloading Forge you can run the file with Java.

2

Prepare

Lounch Minecraft and select your Forge istallation as Version this will create a Folder called Mods.

3

Add Mods

Type Win+R and type %appdata% and open the .minecraft Folder. There will you find your Folder called Mods. Place all Mods you want to play in this Folder

4

Enjoy

You are now Ready. Re-start your Game and start Playing.

More Mods like this

Controlling

Adds a search bar to the Key-Bindings menu

Crafting Tweaks

Allows you to rotate, balance or clear the crafting matrix by the press of a button, in any (supported) crafting window.

Client Tweaks

There, I fixed Minecraft for you. Various optional tweaks to improve Minecraft Quality of Life.

TrashSlot

Adds a trash slot to the inventory screen that allows deletion of unwanted items.

TipTheScales

Allows for more options when adjusting the GUIScale option as well as making it a slider.

Configured

Automatic in-game configuration menus for every mod!

Charm

A vanilla+ mod inspired by Quark, adding lots of small things to the game.