Skip to content

Commit 870c8dd

Browse files
committed
Added mention player notification in action bar.
1 parent a4fd713 commit 870c8dd

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

  • src/main/kotlin/com/mairwunnx/projectessentials/chat

src/main/kotlin/com/mairwunnx/projectessentials/chat/EntryPoint.kt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,20 @@ class EntryPoint : EssBase() {
113113
}
114114
}
115115

116+
if (mentions.isNotEmpty()) {
117+
event.player.server.playerList.players.forEach {
118+
val sortedMentions = mentions.sorted()
119+
if ("@${it.name.string}" in sortedMentions) {
120+
it.sendStatusMessage(
121+
TextComponentUtils.toTextComponent {
122+
"§7you are mentioned by §l§7${event.player.name.string}§7 player, in the chat."
123+
},
124+
true
125+
)
126+
}
127+
}
128+
}
129+
116130
if (!ChatUtils.isGlobalChat(event)) {
117131
val players = event.player.serverWorld.getEntitiesWithinAABB(
118132
event.player.entity.javaClass, AxisAlignedBB(

0 commit comments

Comments
 (0)