Hysk Tooltips Project Overview

Hysk Tooltips is a Fabric client-side mod that displays the vanilla item tooltip near the center of the screen when you look at a dropped item on the ground. It offers extensive customization options including position offset, anchor point, display delay, and automatically adapts to the fancy rendering styles of Obscure Tooltips and Enhanced Tooltips. This mod was developed with the assistance of Deepseek and is a public welfare mod for the Qing Xin Heng Yue Time-Space Server.
- Producer: YkinLing
- Auxiliary AI: Deepseek
- QQ Group: 783492491 (For obtaining the source code)
Project Structure
Below is a list of all source code and related configuration files of this mod:
| File | Description |
|---|---|
ModConfig.java |
Configuration class defined using Cloth Config API, containing all adjustable options. |
ModMenuIntegration.java |
Integrates the config screen with Mod Menu, allowing players to open the configuration screen via Mod Menu. |
ExampleMixin.java |
Example Mixin class (not actually used), demonstrating Mixin injection. |
HudTooltipPicker.java |
Core logic class: responsible for raycasting dropped items, handling look delay, tracking item states, and maintaining multi-item mode. |
HudTooltipRenderer.java |
Implements HudRenderCallback, renders tooltips according to current mode (single/multi/forced), and automatically detects the presence of Obscure Tooltips to switch rendering styles. |
Hysktooltips.java |
Mod main entry point (ModInitializer), only outputs initialization logs. |
HysktooltipsClient.java |
Client initialization entry: registers configuration, HUD rendering callback, key binding (force show key), and listens for key state changes. |
HysktooltipsDataGenerator.java |
Data generation entry (unused). |
en_us.json |
English language file. |
zh_cn.json |
Chinese language file. |
fabric.mod.json |
Fabric mod metadata file, defining mod ID, version, entrypoints, dependencies, etc. |
hysk-tooltips.mixins.json |
Mixin configuration file, declaring the Mixin classes used. |
README_CN.md / README_EN.md |
User documentation in Chinese and English. |
Core Features
- Basic Display: When the player's crosshair points at a dropped item (
ItemEntity), the item tooltip is shown at a configurable screen position. - Position Customization: Via
tooltipXOffset,tooltipYOffsetandanchorsettings, you can freely adjust the tooltip's offset and anchor relative to the screen center. - Look Delay: Enable
enableDelayand setdelayTimeMsto prevent the tooltip from flickering. - Follow Mode: When
followEnabledis on, the tooltip follows the item's movement on screen and can linger after looking away (followDelayMs). - Multi-Item Support: Enable
multiItemEnabledto display up to 5 item tooltips simultaneously, each independently managing its own look delay and disappear delay (multiItemDelayMs,multiItemDisappearDelayMs). - Super Range Tooltips: Enable
superRangeEnabledto allow looking at distant dropped items while sneaking (distance set bysuperRangeDistance, default 128 blocks). In force mode, distance limit is also ignored. - Avoid Overlap: Enable
avoidOverlapto automatically reposition multiple tooltips (radial search) to prevent overlapping in multi-item mode. - Force Display Mode: Press the configured key (default Left Shift) to forcibly show tooltips for nearby dropped items. Behavior controlled by
shiftEnabledandshiftRequiresTarget, and limited byforceMaxItems(closest to your view, default 15). - Automatic Tooltip Enhancement Mods Adaptation: If Obscure Tooltips or Enhanced Tooltips is installed, the tooltips automatically use their enhanced styles (gradients, animations, particles, etc.); otherwise, they fall back to the vanilla style.
Configuration Options Explained
The fields in the ModConfig class correspond to the following options (can be edited directly in config/hysk-tooltips.json or via the Mod Menu interface):
| Option | Type | Default | Description |
|---|---|---|---|
enabled |
boolean | true | Whether the mod is enabled. |
tooltipYOffset |
int (-100~100) | 0 | Vertical offset of the tooltip (pixels, positive moves down). |
tooltipXOffset |
int (-100~100) | 0 | Horizontal offset of the tooltip (pixels, positive moves right). |
anchor |
enum | TOP_LEFT | Anchor point of the tooltip relative to screen center (Top Left, Top Right, Bottom Left, Bottom Right). |
enableDelay |
boolean | true | Whether to enable look delay. |
delayTimeMs |
int (0~2000) | 200 | In single-item mode, how many milliseconds to wait after looking at an item before showing its tooltip. |
followEnabled |
boolean | true | Whether to enable follow mode. |
followDelayMs |
int (0~2000) | 200 | In follow mode, how long the tooltip remains after looking away (milliseconds). |
multiItemEnabled |
boolean | false | Whether to enable multi-item tooltips (requires follow mode to be enabled). |
multiItemDelayMs |
int (0~2000) | 200 | In multi-item mode, how many milliseconds to wait after looking at an item before showing its tooltip. |
multiItemDisappearDelayMs |
int (0~10000) | 5000 | In multi-item mode, how long the tooltip remains after looking away (milliseconds). |
shiftEnabled |
boolean | true | Whether to enable Shift force mode. |
shiftRequiresTarget |
boolean | true | In force mode, whether you must first look at an item before pressing Shift to show all nearby item tooltips. |
superRangeEnabled |
boolean | false | Whether to enable super range tooltips. |
superRangeDistance |
int (16~256) | 128 | Maximum distance (in blocks) to look at dropped items while sneaking in super range mode. |
avoidOverlap |
boolean | false | Whether to enable tooltip overlap avoidance (multi-item mode only). |
forceMaxItems |
int (2~50) | 15 | Maximum number of dropped items shown in force mode, selected by proximity to view direction. |
Compatibility Note: Tooltip Enhancement Mods and Multi-Item Mode
Obscure Tooltips Multi-Item Icon Disappearance Issue
Symptom
When both Hysk Tooltips' multi-item mode (multiItemEnabled = true) and Obscure Tooltips are enabled, some icons in the item tooltips (e.g., enchantment icons, durability bars) may disappear, or animations (like particles) may not work correctly. However, in single-item mode, all icons and animations work normally.
Cause Analysis
Obscure Tooltips internally maintains a TooltipState object for the currently rendered tooltip, which includes animation time (timeInSeconds) and other state information. This state accumulates over time to enable smooth animations (e.g., rotating icons, particle emission). The key point is: as long as the same item stack (ItemStack) is rendered consecutively, the same TooltipState is reused, allowing the animation time to increase continuously.
- Single-item mode: Hysk Tooltips renders only one item per frame (the currently targeted dropped item). Since the item does not change, Obscure Tooltips always sees the same
ItemStack, thus the sameTooltipStateis reused, animation time accumulates, and icons display normally. - Multi-item mode: Hysk Tooltips renders multiple different items per frame. For each item, Obscure Tooltips creates a new
TooltipState(because the items are different), causing each item's animation time to reset to zero every frame. This results in icons "disappearing" or animations failing to play properly (e.g., particles only flicker for one frame).
Conclusion
Hysk Tooltips cannot perfectly support multi-item mode with Obscure Tooltips without modifying Obscure Tooltips itself. Obscure Tooltips is inherently designed for single-tooltip rendering; its state reuse relies on the item being the same, and it lacks the ability to manage multiple independent tooltip states simultaneously. To fully support multi-item mode, Obscure Tooltips would need to be changed (e.g., maintain a map of TooltipState per item). As a caller, Hysk Tooltips cannot bypass this limitation.
Recommendations
- If you wish to use the full effects of Obscure Tooltips, it is recommended to disable multi-item mode (
multiItemEnabled = false) or use only single-item mode. - If you still want to experience multi-item tooltips, you may consider temporarily disabling Obscure Tooltips, or accept that some icons will be missing (the tooltip text will still display correctly).
Enhanced Tooltips Support
Hysk Tooltips fully supports multi-item mode when used with Enhanced Tooltips. Enhanced Tooltips is designed with proper support for rendering multiple independent tooltips simultaneously; it maintains separate state for each item stack, allowing smooth animations, icons, and effects to display correctly even when several tooltips appear at once.
You can safely enable multiItemEnabled = true alongside Enhanced Tooltips and enjoy the full visual enhancement without any icon disappearance or animation interruption. This makes Enhanced Tooltips the recommended choice for players who wish to use a tooltip enhancement mod together with Hysk Tooltips' multi-item features.
Dependencies
- Required: Minecraft 1.21.11, Fabric Loader >=0.18.4, Fabric API.
- Optional:
- Cloth Config API: Provides the configuration screen.
- Mod Menu: Allows easy access to the configuration screen in-game.
- Obscure Tooltips: Enhances tooltip rendering styles (note the compatibility issue with multi-item mode).
- Enhanced Tooltips: Enhances tooltip rendering styles (fully compatible with multi-item mode).
License
BSD 2
Project members

ykinLing
Member

