We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent be42920 commit 4dd30d2Copy full SHA for 4dd30d2
mod/src/main/kotlin/gg/skytils/skytilsmod/utils/multiplatform/chat.kt
@@ -18,6 +18,7 @@
18
19
package gg.skytils.skytilsmod.utils.multiplatform
20
21
+import gg.essential.universal.UMinecraft
22
import net.minecraft.text.ClickEvent
23
import net.minecraft.text.HoverEvent
24
import net.minecraft.text.MutableText
@@ -39,6 +40,9 @@ fun MCTextComponent.map(action: Text.() -> Unit) {
39
40
siblings.forEach { it.map(action) }
41
}
42
43
+fun MCTextComponent.chat() =
44
+ UMinecraft.getMinecraft().inGameHud.chatHud.addMessage(this)
45
+
46
fun MutableMCTextComponent.setHoverText(text: String) = apply {
47
setStyle(style.withHoverEvent(HoverEvent.ShowText(Text.literal(text))))
48
0 commit comments