#Tooltip error `Wrapped java.lang.IndexOutOfBoundsException: Index: #, Size: #`
17 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
Paste version of client.log from @fresh jackal
the script in particular:
let narrowWines = [
'vinery:glowing_wine',
'vinery:solaris_wine',
'vinery:noir_wine',
'vinery:red_wine',
'vinery:cherry_wine',
'vinery:kelp_cider',
'vinery:bolvar_wine',
'vinery:villagers_fright',
'vinery:clark_wine',
'vinery:stal_wine',
'vinery:bottle_mojang_noir',
'nethervinery:netherite_nectar',
'nethervinery:lava_fizz',
'nethervinery:nether_fizz',
'nethervinery:improved_lava_fizz',
'nethervinery:improved_nether_fizz'
]
narrowWines.forEach(wine => {
event.addAdvanced(wine, (item, advanced, text) => {
text.add(6, [Text.of("Narrow wine bottle").gray().italic()])
})
})
Tooltip error Wrapped java.lang.IndexOutOfBoundsException: Index: #, Size: #
it seems to be working, it's just causing a ton of errors in the KJS client log
🤷
It seems to be complaining that there are only 3 tooltip lines and not 6, and you're trying to insert something after the 6th line
i guess the potion effect and empty line below it might not count?
for your case you can probably just remove the number entirely to have your tooltip added to the end
three tooltip lines despite appearing as like… how many, 5??? goodness gracious
I just wanted the tooltip to be right before the item ID was all
if I could find a more efficient way to accomplish that, that’d be helpful
in solving this error
Does text.add() put the lines after the item id by default? i haven't used the tooltip event in a while
if that's the case you probably have to try writing to the highest line your logs know or one before
apparently so, at least in my tests. hence why I’m specifying an index
or attempting to, anyway
I’ll play around with the index whenever I get the chance