#Is it possible to remove tooltips?
12 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
https://mods.latvian.dev/books/kubejs/page/itemtooltipeventjs i only found this
A client event that allows adding tooltips to any item!
onEvent('item.tooltip', tooltip => {...
It is possible to remove tooltips?
Is it possible to remove tooltips?
yes
[Quote ➤](#archived-example-scripts message) Small 1.19.2 script that removes the stat bits at the bottom of tools and armour
const remove = (index, text) => {
text.remove(index)
return index - 1
}
const keyContains = (string, component) => {
let key = component?.contents?.key
return key != null && key.contains(string)
}
ItemEvents.tooltip(event => {
event.addAdvanced(Ingredient.all, (s, a, text) => {
let isStatSection = false
for (let i = 0;i < text.size();i++) {
let component = text.get(i)
if (keyContains("item.modifiers", component)) {
isStatSection = true
i = remove(i, text)
i = remove(i, text)
continue
}
if (isStatSection) {
if (keyContains("attribute", component)) {
i = remove(i, text)
continue
}
for (let c of component.getSiblings()) {
if (keyContains("attribute", c)) {
i = remove(i, text)
}
}
}
}
})
})
Could be ported to 1.18.2, but I can't be bothered. All required changes are also done to the ench desc script, so can copy from there
this is a little more complicated than you need
xDD thx, but this is kubejs 6 i think, need i just to change the events?
oh saw the command xD i will port it
/ticket close
Ticket closed!