It'd be one thing if all i wanted was to just add lore to an item. what i'm trying to achieve is a tooltip with a functioning shift option to show more info. the issue is that client scripts cant run on a server (unless you f3+t every time you join a server session)
I was referencing to stuff like this #off-topic message but this is from wayy back and im not sure if its even what i'm looking for
#Adding tooltips in a server script
107 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
[Quote ➤](#off-topic message) ```kt
package ky.someone.mods.vacuous.util
import net.minecraft.ChatFormatting
import net.minecraft.client.gui.screens.Screen
import net.minecraft.network.chat.*
import net.minecraft.util.Mth
import java.util.function.UnaryOperator
@JvmField
val TOOLTIP_MAIN = UnaryOperator<Style> {
it.withColor(0xfcb95b)
}
@JvmField
val TOOLTIP_SIDENOTE = UnaryOperator<Style> {
it.withColor(0x0fd1ec).withItalic(true)
}
@JvmField
val COLOUR_TRUE = UnaryOperator<Style> {
it.withColor(0x4ecc8d)
}
@JvmField
val COLOUR_FALSE = UnaryOperator<Style> {
it.withColor(0xfd6d5d)
}
@JvmField
val COLOUR_INFO = UnaryOperator<Style> {
it.withColor(0x5555ff)
}
fun appendInfoTooltip(tooltip: MutableList<Component>, info: List<Component>) {
val isShift = Screen.hasShiftDown()
tooltip.add(
"ℹ".asText()
.append(" (Shift)".asText().withStyle(if (isShift) ChatFormatting.DARK_GRAY else ChatFormatting.GRAY))
.withStyle(COLOUR_INFO)
)
if (isShift) {
tooltip.addAll(info)
}
}
val tickGreen: MutableComponent
get() = "✔".asText().withStyle(COLOUR_TRUE)
val tickRed: MutableComponent
get() = "✘".asText().withStyle(COLOUR_FALSE)
fun styledBool(b: Boolean): MutableComponent = if (b) tickGreen else tickRed
// returns a new style using "parent" with a colour representing
// the given ratio of the range [0, 1] (0 = red, 1 = green)
fun styledRatio(parent: Style, ratio: Double): Style = parent.withColor(Mth.hsvToRgb((ratio / 3).toFloat(), 1f, 1f))
fun asStyledValue(value: Number, max: Number, formattedValue: String = value.toString()): MutableComponent =
formattedValue.asText().withStyle(styledRatio(Style.EMPTY, value.toDouble() / max.toDouble()))
fun String.asText(): MutableComponent = TextComponent(this)
fun String.asTranslate(vararg replacements: Any): MutableComponent = TranslatableComponent(this, *replacements)
operator fun MutableComponent.plus(other: String): MutableComponent = append(other)
operator fun MutableComponent.plus(other: Component): MutableComponent = append(other)
i also found this forge event https://lexxie.site/forge/1.19.2/net/minecraftforge/client/event/RenderTooltipEvent.html not sure if its usable tho
declaration: package: net.minecraftforge.client.event, class: RenderTooltipEvent
why do you need to do this in server scripts?
cause client scripts dont work on servers, i mean they do but you have to do f3+t to see the tooltips
well yeah obviously they dont :P
buti still dont know why you need tooltips on server
server doesnt do tooltips
well im creating a modpack for my friends and i to play on and once i get a server going its going to be really annoying that they wont be able to see some tooltips i add onto certain items
well if they add them correctly, they will see it 
well yeah i mean they'll all have the client script except even though both server and client have the script it still doesnt show til you reload textures
even doing /kubejs reload client_scripts doesnt work without f3+t
the client script folder is completely ignored on a dedicated server
client
dang
i did on client scripts, though when i go to a dedicated server they dont work
hence me tryna get a server script going somehow
something is sussy wussy with the script then
is it possible to remove certain nbt from an item? i could maybe use lore
oh you think?
one sec lemme post it
yeah i mean i was thinking of maybe setting a tick script to put nbt on each item that a player recieves
cursed af tho to do that
youre doing that XY thing 
The XY problem is when you really want to do X, and you think that Y can achieve X. However, you can't get Y to work, and so ask for help exclusively about Y.
This can lead to a lot of confusion from the people trying to help you, as Y can seem like a very random thing to want to do, and a lot of the time isn't the best way to achieve X anyway.
Its fine to ask about Y, just always include some context about X so you can be put on the right track if Y won't do X well, or there is an easier way to do X.
this is the client script btw if you wanna take a look
Paste version of originskeytooltips.js from @pliant trout
crap youre right
i just dont know how to do it lmao
You can just… put client script on git for ur friends?
no i mean itll be on curseforge and they'll download everything
btw quick sidenote, instead of Text.of('-25% ').red() you can just do Text.red('-25% ')
Vscode can even commit for you
thats not the issue
im saying that even though its the same on both sides it doesnt load the tooltips til you refresh textures with f3+t
ah fair enough lol
can you show me your client log when youre log in the first time to a server?
True because f3+t reloads all of your assets ingame
ye but assets have nothing to do with tooltips
um
no client script errors either
happens to me all the time
it wasnt working with the other script i had and now that i tested it out with this one it works
online and irl
had something similar happen at work a while ago
oh fr
spent a few hours trying to get something to work
then i called a coworker
and instantly worked

lmaooooo
i was like
fair enough lmao
Ticket closed!
you reopened the ticket with the reaction
event.addAdvanced(['#artifacts:artifacts'], (item, advanced, text) => {
if (item.nbt.Springy){
text.add([
Text.of('Quality: ').gray(),
Text.of('Springy').blue()
])
text.add([
Text.of('When in any curios slot:').gray()
])
text.add([
Text.of('+0.5 Jump Height').blue()
])
}
})
})``` This was the client script i was talking about that wouldnt work til you did f3+t
guess it mightve been because of the item tag
also even just reacting to posts reopens it? jeez fair enough
any interaction does that, its just how discord is
Ticket closed!
wow the timing
lol
lmao
i was typing about your snippet
got it
xD
hahahha
but it works now?
yeah
ah cool
guess it doesnt work right if you go by tags
tags are fucky sometimes

