Skip to content

Commit d05d039

Browse files
committed
feature autoreply for constructor to look at
1 parent 3500a1b commit d05d039

File tree

1 file changed

+31
-0
lines changed
  • common/src/main/kotlin/com/lambda/module/modules/player

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
}

0 commit comments

Comments
 (0)