▶️ ЗАБЕРИ СВОИ 8 ПОДАРКОВ 🎁 ПРИ СОЗДАНИИ СВОЕГО МАЙНКРАФТ СЕРВЕРА
Моды/Hidden description
Hidden description

Hidden description

Item description hidden, hold shift to view

Оцените первым
62
0

feat(tooltip): Implement conditional tooltip expansion with Shift key

This commit introduces a new client-side quality-of-life feature that modifies how item tooltips are displayed in the game. When a player is viewing an item's tooltip, a placeholder message "Hold Shift for details..." is shown by default. Pressing and holding the Shift key reveals the full, complete tooltip, providing an organized and clean inventory browsing experience.

Background / Problem:

  • Tooltips in Minecraft can become excessively long, especially in modded environments where items often carry detailed descriptions, enchantment information, and mod-specific metadata.
  • A cluttered tooltip obstructs the player's view and makes inventory management cumbersome, as crucial information is always visible whether needed or not.
  • There is currently no vanilla or standard Forge method to toggle tooltips or hide them behind a modifier key.

Implementation Details:

  • Created a new event handler that listens to the ItemTooltipEvent (Forge's API event for tooltip construction).
  • When the event is triggered, the handler checks the state of the Shift key using Screen.hasShiftDown() (client-side) to determine if the player is holding the key while hovering over the item.
  • If the key is pressed, the original, unmodified tooltip text list (List) is added to the tooltip, showing every line of information.
  • If the key is not pressed, the default tooltip is cleared and replaced with a single-line component: "Hold Shift for details...".
  • The tooltip is automatically updated and re-rendered each time the player's key state changes while the item is hovered over.

Changes in Behavior:

  • Players can now quickly glance at an item without being overwhelmed by lengthy text.
  • The full tooltip is instantly revealed when needed, without any additional keybinds or configuration menus.
  • The placeholder text is localized and can be adapted or internationalized by future updates.
  • This feature works on all items, including those from other mods, because it intercepts the tooltip event at a generic level.

Testing Performed:

  • Verified on Forge 1.20.1 with both vanilla and modded items (e.g., items with enchantments, modded equipment).
  • Confirmed that the Shift key detection works reliably in all game screens (inventory, creative menu, containers).
  • Tested the responsiveness of the tooltip when the key is pressed, released, and pressed again while the mouse remains on the same item.
  • Ensured compatibility with other mods that also modify ItemTooltipEvent through event priority adjustments.

Additional Notes:

  • This mod is fully client-side and does not require any server-side installation.
  • The Screen.hasShiftDown() method is used over keyBindSneak to accurately reflect GUI-related key presses without interfering with movement controls.
  • Future consideration: Adding a configurable keybind to toggle this behavior or customize the placeholder message.

Resolves: #ISSUE-42 (Replace with actual issue ticket number if applicable)

Партнёрский материал

Как поиграть с друзьями с модом Hidden description?

Мод Hidden description куда интереснее в компании: поднимите сервер Майнкрафт с уже установленным модом, позовите друзей и играйте по своим правилам. Хостинг Майнкрафт для мода Hidden description будет готов за пару минут - BungeeHost сделает всё за вас.

Часто задаваемые вопросы

Совместимость

Minecraft: Java Edition

1.20.x

Платформы

Поддерживаемые окружения

Клиент и сервер

Детали

Лицензия:
Опубликован:3 месяца назад
Обновлён:3 месяца назад
Главная