How can I check for a certain chat message and then execute some code?
Unsolved
ScriptAPI
-
var S02 = Java.type("net.minecraft.network.play.server.S02PacketChat"); module.on('packet', function (e) { var packet = e.getPacket(); if (packet instanceof S02) { var msg = packet.getChatComponent().getUnformattedText(); if (msg.contains("string goes here")) { // your code } } }
-
@ali00035_ Is this using API v1 orv 2?
-
@bosscreeper48 its on scriptapi v2
-
@ender1355-0 ty
-
@bosscreeper48 np, btw you can check the LB ScriptAPI docs to learn more
-
@ender1355-0 yes thats what im doing rn
-
@bosscreeper48 then you're good to go
-
This post is deleted!