- Java 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| gradle/wrapper | ||
| src | ||
| .gitignore | ||
| AGENTS.md | ||
| build.gradle | ||
| gradle.properties | ||
| gradlew | ||
| gradlew.bat | ||
| LICENSE | ||
| README.md | ||
| settings.gradle | ||
GifSearchAndView
A Fabric client mod for Minecraft 1.21.11 that searches Giphy or Klipy and lets you copy or share GIFs without leaving the game.
GifSearchAndView is a Fabric mod (the existing 1.21.11 test instance uses Fabric Loader). It is client-side only and works on any server.
Features
/gif <search>opens a grid of Giphy or Klipy thumbnails./gifwith no query opens the same screen with a search box.- The GIPHY / Klipy button next to the search box switches the search source. The choice is remembered between sessions.
/addgif <link>saves a GIF from Giphy, Tenor, Imgur, Gfycat/RedGifs, Klipy, or any page with OpenGraph/Twitter image tags. The thumbnail URL is generated automatically and no Giphy key is needed. Klipy page links are looked up through the Klipy API, so they need a Klipy key.- Every result has:
- Copy - copies the page link (never the short link) to your clipboard.
- Party - sends a short link to party chat.
- Guild - sends a short link to guild chat.
- Save to fav - stores the GIF in your favorites.
- Right-click a thumbnail or click ⋯ to copy the direct GIF/WebM URL or open the page in your browser.
- Links in player chat are detected automatically. Hover a detected GIF or WebM link in the open chat to see an animated preview in the centre of the screen. The first time a link arrives, a one-time popup with an animated thumbnail appears in the top-right corner.
- Chat previews only contact a small allowlist of GIF hosts (
giphy.com,gph.is,tenor.com,imgur.com,klipy.com,redgifs.com,pixabay.comand the mod's ownis.gdshort links). Action bars and the mod's own feedback never trigger a preview; non-overlay system messages are checked too, because some servers deliver chat that way. - Shared links are shortened: Giphy results use the
gph.islink from the API, Klipy and other links useis.gd. Copy always keeps the full page URL. - WebM and MP4 sources are previewed as animations when a local
ffmpegis available. Without it (or with WebM decoding turned off), the still thumbnail is shown instead. /favshows your saved GIFs with thumbnails and:- Copy / Party / Guild
- Delete - click once, then click Sure? within 3 seconds to confirm.
- Rename - gives the favorite a custom name shown above the thumbnail.
- Settings screen (Mod Menu or
/gifconfig) for both API keys, content rating, party/guild chat commands, hiding the Guild button, chat previews, hover previews, the top-right popup, short links, and WebM/ffmpeg options. - Mouse wheel and Prev / Next buttons page through results.
- On startup (and via
/gifupdate) the mod checks the project's releases for a newer build; if one is found you are asked whether to update. Update now downloads the new jar into your mods folder (the old jar is removed when the game exits), Download & exit does the same and then closes the game so the new build is used on the next launch, and Later dismisses the prompt for that version. - Thumbnails are downloaded asynchronously and cached as textures.
- Hover over a thumbnail for a moment to animate it. The Giphy
_stillimage is shown at rest, and the animated GIF is only downloaded when needed.
Requirements
- Minecraft 1.21.11
- Fabric Loader 0.20.1 or newer
- Fabric API 0.141.6+1.21.11 or newer
- Java 21
- Mod Menu 17.0.1 (optional, for the in-game settings screen)
ffmpeg(optional, for animated WebM/MP4 chat previews).ffprobeis used when present; it is looked up next to a configuredffmpegpath or onPATH. Without ffmpeg, WebM links still show a still frame.- If ffmpeg is not installed, the mod can download a managed build for you:
open the config screen (
/gifconfigor Mod Menu), go to Chat & previews, and click Download / update ffmpeg. The binary is stored inconfig/gifsearchandview/ffmpeg/and used automatically. The download is a pinned release whose SHA-256 checksum is built into the mod, and it never updates on its own; use the same button or/downloadffmpegto reinstall.
Setup (API keys)
The mod can search Giphy and Klipy. Each provider needs its own API key; you only need a key for the providers you use.
- Giphy - create a free key at https://developers.giphy.com/dashboard/.
- Klipy - create a key in the partner panel at https://partner.klipy.com/api-keys. Keys in testing mode are limited to 100 requests per hour; request production access for unlimited use.
The Klipy key is also used to resolve Klipy page links in chat and /addgif,
because Klipy's public pages block automated access.
The first time you run /gif with a provider that has no key, the search screen
shows a key field for that provider:
- Paste the key into the field below the search box.
- Click Save key. The mod saves it and runs the current query.
Use the GIPHY / Klipy button next to the search box to switch providers.
If the newly selected provider has no key, its key field appears; otherwise the
current query is searched again with that provider. You can change either key,
the content rating, chat commands, Guild button visibility, chat previews, short
links, and ffmpeg settings from the Mod Menu config screen, or by running
/gifconfig if Mod Menu is not installed.
The keys are stored in config/gifsearchandview.json. You can also set the
GIPHY_API_KEY and KLIPY_API_KEY environment variables, which override the
config file, or edit the file directly:
{
"apiKey": "YOUR_GIPHY_KEY_HERE",
"klipyApiKey": "YOUR_KLIPY_KEY_HERE",
"searchProvider": "giphy",
"rating": "pg-13",
"resultLimit": 50,
"partyCommand": "p",
"guildCommand": "g",
"hideGuildButton": false,
"chatPreviews": true,
"chatHoverPreview": true,
"chatLinkToast": true,
"useShortLinks": true,
"webmBackend": "auto",
"ffmpegPath": "ffmpeg",
"checkForUpdates": true,
"dismissedUpdateVersion": ""
}
On first launch after upgrading from the old project name, existing
forgegiphy.json, forgegiphy-favorites.json, and
forgegiphy-shortlinks.json files are renamed to the new names, and the legacy
forgegiphy/ config folder (including the managed ffmpeg download) is moved to
gifsearchandview/. The rename/move only happens when the new file or folder
does not already exist, so current settings are never overwritten.
| Field | Meaning |
|---|---|
apiKey |
Your Giphy API key. |
klipyApiKey |
Your Klipy API key. |
searchProvider |
Last selected source: giphy or klipy. |
rating |
Content rating: y, g, pg, pg-13, or r. Giphy uses it directly; for Klipy it is mapped to content_filter (y/g → high, pg → medium, pg-13 → low, r → off). |
resultLimit |
Number of results to fetch (1-100). Klipy is capped at 8-50 per request. |
partyCommand |
Chat command used by Party, without a leading /. |
guildCommand |
Chat command used by Guild, without a leading /. |
hideGuildButton |
Hide the Guild button on the search and favorites screens. |
chatPreviews |
Detect GIF/WebM links in player chat. |
chatHoverPreview |
Show the centred animated hover preview in chat. |
chatLinkToast |
Show the one-time top-right popup for a new chat link. |
useShortLinks |
Send gph.is / is.gd links to party and guild chat. Copy always keeps the full URL. |
webmBackend |
auto decodes WebM/MP4 with ffmpeg when available; off always uses a still frame. |
ffmpegPath |
ffmpeg on PATH, an absolute path, or the managed download location. |
previewHostAllowlist |
Restrict chat previews to the hosts in previewHosts. |
previewHosts |
Comma-separated host suffixes allowed for chat previews. |
checkForUpdates |
Check the project releases for a newer mod build on startup. |
dismissedUpdateVersion |
Last update version dismissed in the update prompt. |
The default p / g commands match Wynncraft. For Hypixel, change them to
pc / gc. Any server command that accepts a message works.
Favorites
Favorites are saved to config/gifsearchandview-favorites.json. The file stores the
GIF ID, title, static thumbnail URL, animated preview URL, direct media URL, the
human-facing page URL, an optional short link, and your custom favorite name.
Older favorites without the newer fields still load; their existing links are
used as fallbacks.
Short-link results are cached in config/gifsearchandview-shortlinks.json.
Temporary WebM files are written under config/gifsearchandview-cache/webm and
removed after decoding (or at the next startup after a crash).
Usage
- Run
/gif funny cat(or/gifand type a query). - Use the GIPHY / Klipy button to pick the search source. Switching keeps your query and searches the other provider.
- Click Copy, Party, Guild, or Save to fav beneath a thumbnail. Right-click a thumbnail (or click ⋯) for the direct GIF URL and the browser link.
- Run
/addgif <link>to save a GIF from a page or direct media link, for example/addgif https://tenor.com/view/cat-cat-dance-gif-7523542997650649169or/addgif https://media.giphy.com/media/3o7aD2saalBwwftBIY/giphy.gif. Klipy page links need a Klipy key; directstatic.klipy.commedia links do not. - Run
/favto view, rename, share, or delete saved GIFs. - Open chat while another player posts a GIF link. Hover the link for the centred preview; the first time it arrives, a popup also appears in the top-right corner. Links already seen in this session do not pop up again.
- Run
/gifconfig(or use Mod Menu) to change the Giphy and Klipy API keys, rating, chat commands, Guild button, chat previews, short links, and ffmpeg path. - Run
/downloadffmpegto download or update the managed ffmpeg build without restarting the game. - Run
/gifupdateto check for a newer mod build and, if available, download it into your mods folder. - Run
/gifhelpto list all mod commands and their descriptions.
Building
The Gradle wrapper is included:
./gradlew build
The remapped mod jar is written to build/libs/.
To try it in a development client:
./gradlew runClient
Notes
- The mod is client-side only; it does not need to be installed on the server.
- Grid thumbnails are static until hovered. Animated versions are downloaded on hover, decoded into frames, and kept in a small in-memory cache; if a GIF cannot be decoded, the static thumbnail stays visible.
- Chat links are only previewed from a small allowlist of known GIF hosts. Downloads are size-limited, decoded with frame/size caps, and private or local addresses are refused. Chat and non-overlay system messages are checked; action bars and the mod's own feedback are ignored.
is.gdsees the full link when a shared link is shortened. Set"useShortLinks": falseto disable this; Party and Guild then send the full page URL. Copy always uses the full URL.- WebM/MP4 animation requires a local
ffmpegand runs it as a separate process. The mod does not bundle ffmpeg in the jar, but can download a checksum-pinned managed build intoconfig/gifsearchandview/ffmpeg/from the config screen; it only changes when you explicitly ask it to. Disable animation with"webmBackend": "off"to always use still frames. - When the managed ffmpeg build is outdated, the mod notifies you in chat with
a clickable
/downloadffmpegcommand (and the same command is clickable in/gifhelp). - Sending a GIF uses the configured party/guild chat command. Servers may truncate very long messages or block links.
- This project is not affiliated with Giphy or Klipy. Giphy's and Klipy's API terms apply, including Klipy's request limits for testing keys. Klipy media is loaded directly from the URLs it returns, its results are shown in their original order in their own grid, and the Klipy toggle labels the source.