[Fabric 1.20.1] BuilderBase.displayName and ItemBuilder.tooltip support string arguments, but are not typed as such
Martmists-GH opened this issue ยท 7 comments
According to their typings, a net.minecraft.network.chat.Component
is required.
A Component
is also typed as string
following the conversion doc. It's similar to where you can type item names at places accepting ItemStack
and get completions.
ProbeJS will try to keep the type name as original to retain as much info from type names as possible. For example, you might don't know that Component
can also be a:
type ComponentObject = {
"text"?: string,
"translate"?: Special.LangKey,
"with"?: (any)[],
"color"?: $Color$$Type,
"bold"?: boolean,
"italic"?: boolean,
"underlined"?: boolean,
"strikethrough"?: boolean,
"obfuscated"?: boolean,
"insertion"?: string,
"font"?: string,
"click"?: $ClickEvent$$Type,
"hover"?: $MutableComponent$$Type,
"extra"?: ($MutableComponent$$Type)[]
}
The completion feature you're mentioning does not seem to exist in 6.0.0, unless this is part of the vscode plugin (which obviously does not work on Jetbrains products, nor does tsc accept it).
Fabric is not supported because v7.0.0 on 1.20.1 is a preliminary version for the ProbeJS on 1.21, and KubeJS on 1.20.4+ only supports NeoForge.
Due to the weakly typed nature of JavaScript, the IDE should be able to accept string
for the Component type without throwing an error, if your IDE does not support that, think about switching to VSCode.