Tags
Creators
Details
Licensed MIT
Published 6 months ago
Updated 1 hour ago
All versions
2.1.0+mc26.2-neoforge
Release
WebGUI 2.1.0 (26.2 NeoForge)4 hours ago 0
Compatibility
Minecraft: Java Edition
26.2
Platform
NeoForge
Supported environments
Client and server
Changes
2.1.0 - 2026-12-01
Added
- The game's font, for pages.
window.webgui.gameFontis a stylesheet that declaresfont-family: "Minecraft": link it and set the family, and a page's text looks like the game's, Cyrillic and accented Latin included. The font is built from the game's own bitmap sheets, from the player's resource packs, into a TrueType file where every pixel is a square, so at sizes that are multiples of 8px it is as crisp as in the game. No font file to ship, and no licence to worry about. Characters the game draws with its fallback unifont are left to the browser's fallback font. (#44) - Placeholders from Text Placeholder API, when it is installed (Fabric). Every
%namespace:name%in a page URL — from/webgui gui,/webgui hud, a bound entity or the config — is filled in for the player the page opens for, URL-encoded:?rank=%luckperms:prefix%arrives as the player's rank. A page can also ask:await webgui.resolvePlaceholders(['player:playtime']), answered only for the ids listed in the newpagePlaceholderssetting inconfig/webgui/server.json, so a page reads what the operator chose to share; any other id comes backnull. Without the mod a URL is left as it is. (#50) - Chat, for pages from a trusted origin. Each message the player receives arrives as a
webgui:chatevent:{ text, json, type, sender? }, wherejsonis the game's own text format so a page can keep the colours,typeischatorsystem, andsender({ uuid, name }) is there for a player's message.window.webgui.sendChat(message)says something in chat as the player, signed like a typed message; anything starting with/is refused, as commands keep going throughrunCommand. Both are limited to the origins intrustedCommandOrigins: a player's chat, private messages included, is not for just any page. At most five messages every ten seconds. The action bar is not chat and is left out. (#51) - The game's own resources, for pages.
window.webgui.gameAssetsis an address a page can appendnamespace/pathto —gameAssets + 'minecraft/textures/item/diamond.png'— and get the file as the player's resource packs have it. A shop or an inventory page can show the real item icons without shipping copies of them, and they change with the player's resource pack. Read-only, behind a token minted once per game, and only what a resource id can name. (#44) - Toasts.
window.webgui.showToast({ title, description, icon, duration })shows a toast in the corner of the screen, drawn like an advancement: the same frame, an item for an icon (minecraft:diamond), a title and a line below it. It belongs to the game rather than the page, so it stays up after the page closes — a shop can close on a purchase and still confirm it. A page may show five every ten seconds; the rest are dropped. (#54)- The server can show one without any page open:
WebviewApi.showToast(player, title, description, icon)or/webgui toast <targets> <title> [description]. It travels as the page eventwebgui:toast, so no new channel is involved; a client older than 2.1.0 hands it to an open page instead of showing it.
- The server can show one without any page open:
client.language— the language the game is set to, such asen_usorru_ru, so a page can pick its own translation to match.navigator.languageis the operating system's, which is not always what the player plays in. Also available as{player_language}in the URL of a GUI bound to an entity; empty on 1.20.1 servers, which do not keep it. (#47)
Fixed
- The 1.21.11 builds no longer claim to run on 1.21.5 – 1.21.10. They declared that range, so the loader accepted them there and the game crashed on start: 1.21.11 renamed a class the mod uses throughout. On an older 1.21 the loader now says the mod needs 1.21.11 instead. Builds before 2.1.0 still declare the old range; use them only on the version they were built for.
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle. To learn more about the Modrinth Maven API, click here.
Note: When available, you should use the creator's maven repo instead as it will have transitive dependency information that the Modrinth Maven API does not. You may also end up with duplicate dependencies if you use a mix of Modrinth and non-Modrinth Maven repositories for your dependencies, because the group identifier will be different when served through the Modrinth Maven API.
Maven coordinates:
Version ID:
build.gradle:
repositories {
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
// forRepositories(fg.repository) // Uncomment when using ForgeGradle
filter {
includeGroup "maven.modrinth"
}
}
}
// Standard Gradle dependency
dependencies {
implementation "maven.modrinth:tDw1xQja:VMdzHzFE"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:tDw1xQja:VMdzHzFE"
}

