Suggestions API
by aratakileo
Suggestions API is a library for Minecraft text input fields, letting other mods attach completion suggestions to them.
What it does
Suggestions API gives mod developers a way to add suggestions to Minecraft's text input fields. Suggestions can be added statically or dynamically, and they can be produced synchronously or asynchronously from the text the user has typed. The library matches entered text against a pattern, including regular expressions, and offers suggestions between the nearest space to the left of the cursor and the cursor itself.
Four suggestion styles are provided ready-made: always shown, simple text with a default or custom showing condition, text with an icon to the left or right, and text suggestions that appear after the user begins entering text. Developers can change how suggestions are rendered, and the library exposes events for suggestion sessions and for a suggestion being selected. It also covers suggestions created outside the library, which can be replaced. The mod runs on client only, so servers do not need it.
Key features
Static and dynamic suggestions
Suggestions can be defined in advance or generated on the fly from the text entered into a field.
Synchronous and asynchronous injection
Two basic injector types add suggestions either directly or in the background, so slow lookups do not block typing.
Pattern matching
Suggestions can be triggered by a specified pattern, including regular expressions, and mapped with a custom condition lambda.
Rendering and events
Developers can change how each suggestion is drawn and react to suggestion sessions starting and suggestions being selected.
Gallery
Compatibility
Latest build for each game version and loader.
Only full game releases are shown. This mod publishes no snapshot builds.
Use cases
Command suggestions
A mod that adds chat commands can use the library to propose argument values as a player types them.
Custom text fields
Mods with their own input screens can attach suggestions to a field without building a completion system from scratch.
Who it’s for: Mod developers who want completion suggestions in Minecraft text fields without writing the matching and rendering code themselves. Players do not need to interact with the library directly.
Questions
Does Suggestions API need to be installed on servers?
Which loaders does Suggestions API support?
Is Suggestions API open source?
In the catalog
Suggestions API is one of 3,514 Library mods on ModsFinder, and one of 2,348 Library mods for Fabric. 13,907 mods support Minecraft 1.20.4.
More from aratakileo
Similar mods
What the author says
for which the library provides ready-made implementations in the form of: - always shown suggestion (texted suggestion with condition to always show it) - simple suggestion (texted suggestion with default or custom showing condition) - icon suggestion (texted suggestion with icon on the left or on the right with…
Official listing
- Modrinth page
- modrinth.com/mod/suggestions-api
- Owner
- aratakileo
- Published
- 2023-09-01
- Updated on Modrinth
- 2024-02-21
- Facts verified
- 2026-10-15
