How can I check for a certain chat message and then execute some code?
-
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 } } } -
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?
-
@ali00035_ Is this using API v1 orv 2?
@bosscreeper48 its on scriptapi v2
-
@bosscreeper48 its on scriptapi v2
@ender1355-0 ty
-
@ender1355-0 ty
@bosscreeper48 np, btw you can check the LB ScriptAPI docs to learn more
-
@bosscreeper48 np, btw you can check the LB ScriptAPI docs to learn more
@ender1355-0 yes thats what im doing rn
-
@ender1355-0 yes thats what im doing rn
@bosscreeper48 then you're good to go
-
@bosscreeper48 then you're good to go
This post is deleted!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login