KubeJS

KubeJS

61M Downloads

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

pm065 opened this issue ยท 0 comments

commented
public boolean isShift() {
    return Screen.hasShiftDown();
}

public boolean isCtrl() {
    return Screen.hasControlDown();
}

public boolean isAlt() {
    return Screen.hasAltDown();
}

Although I've not any knowledge of Java, the existence of these functions seems to indicate that this is possible. This would be incredibly useful for providing item info on-the-fly (I don't really like the JEI information approach; I feel it's not immediately obvious that you find info in JEI and for me it just looks ugly), but I can't figure out how to do this.

Is it something to do with the unexplained advanced parameter in the given advanced tooltip example:

tooltip.addAdvanced('thermal:latex_bucket', (item, advanced, text) => { // This advanced parameter is there with not much explanation
    text.add(0, Text.of('Hello'))
})

For that matter, what does the item one do? I wish I could get this kind of support easier, but I detest Discord with a passion...