KubeJS

KubeJS

61M Downloads

item.tooltip not working

itsdinkd opened this issue ยท 2 comments

commented

MC 1.17.1
Fabric
Latest KubeJS

I tried using item.tooltip like how you used it in your wiki in Server_side, Client_side, and startup, and it doesn't work.

[19:34:17] [ERR ] Error occurred while handling event 'item.tooltip': Can't find method dev.latvian.kubejs.item.ItemTooltipEventJS.add(string,object,object). (client_scripts:tooltip.js#5)


onEvent('item.tooltip', tooltip => {

   tooltip.add('carrier:glove', ["Carry and move any block with a storage", "Line 1"], [text.red('Sneak + Right Click') + ' on block', 'Line 2']);
 });

Not working =/

commented

The 1.17 version is unsupported as listed on the download page in CurseForge.

However, this might be fixed by using items.tooltip instead of item

commented

The issue is actually more that they're using multiple arrays as the parameter, it should just be

onEvent('item.tooltip', tooltip => {
   tooltip.add('carrier:glove', ["Carry and move any block with a storage", text.red('Sneak + Right Click') + ' on block']);
});

The event names haven't changed except for tag events (because of mojang changing things in 1.17)