File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
src/main/kotlin/com/mairwunnx/projectessentials/chat/impl/variables Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,20 @@ package com.mairwunnx.projectessentials.chat.impl.variables
22
33import com.mairwunnx.projectessentials.chat.api.variables.IChatVariable
44import net.minecraft.entity.player.ServerPlayerEntity
5+ import net.minecraft.util.text.ITextComponent
6+ import net.minecraft.util.text.Style
7+ import net.minecraft.util.text.TextComponentUtils
8+ import net.minecraft.util.text.event.ClickEvent
59
610object PlayerVariable : IChatVariable {
711 override val variable = " player"
8- override fun process (player : ServerPlayerEntity ) = player.gameProfile.name!!
12+ override fun process (
13+ player : ServerPlayerEntity
14+ ): ITextComponent = TextComponentUtils .toTextComponent { player.gameProfile.name!! }.setStyle(
15+ Style ().apply {
16+ clickEvent = ClickEvent (
17+ ClickEvent .Action .SUGGEST_COMMAND , " /m ${player.gameProfile.name!! } "
18+ )
19+ }
20+ )
921}
You can’t perform that action at this time.
0 commit comments