Skip to content

(Question): How would you make a tooltip hidden except for when you press shift/ctrl/alt? #163

Discussion options

You must be logged in to vote

In order of your questions:

  1. You can just use these functions like event.isShift() etc. inside your tooltip handler, kind of like this
tooltip.addAdvanced('thermal:latex_bucket', (item, advanced, text) => { 
    if(tooltip.isShiftDown()) {
      text.add(0, Text.of('Hello'))
    }
})
  1. advanced stands for "advanced tooltips", i.e. whether the user has F3+H activated
  2. item is the item stack itself, so you can for example get the item's nbt and such for the tooltip as well

Hope I could answer all of your questions ^^

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@pm065
Comment options

Answer selected by MaxNeedsSnacks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #162 on July 21, 2021 10:29.