File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
common/src/main/kotlin/com/lambda/module/modules/player Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ package com.lambda.module.modules.player
2+
3+ import com.lambda.event.events.PacketEvent
4+ import com.lambda.event.listener.SafeListener.Companion.listener
5+ import com.lambda.module.Module
6+ import com.lambda.module.tag.ModuleTag
7+ import com.lambda.util.Formatting.string
8+ import net.minecraft.network.packet.s2c.play.ChatMessageS2CPacket
9+ import net.minecraft.network.packet.s2c.play.GameMessageS2CPacket
10+
11+ object AutoReply : Module(
12+ name = " AutoReply" ,
13+ description = " Automatically Replies to messages" ,
14+ defaultTags = setOf(ModuleTag .PLAYER )
15+ ){
16+ init {
17+ listener<PacketEvent .Receive .Post >{ event ->
18+ val packet = event.packet;
19+ if (packet !is GameMessageS2CPacket ) return @listener
20+ if (! packet.content.string.contains(" Coords" , true )) return @listener
21+ if (! packet.content.string.contains(" whispers: " , true )) return @listener
22+ var msg = packet.content.string
23+ val sender = msg.split(" whispers: " ).first()
24+ connection.sendChatCommand(" w $sender ${player.pos.string} [${world.dimension.toString()} ]" )
25+
26+
27+
28+ }
29+ }
30+
31+ }
You can’t perform that action at this time.
0 commit comments