Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

LiquidBounce Forum

  1. Home
  2. ScriptAPI
  3. How can I check for a certain chat message and then execute some code?

How can I check for a certain chat message and then execute some code?

Scheduled Pinned Locked Moved Unsolved ScriptAPI
9 Posts 4 Posters 902 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    test55555
    wrote on last edited by
    #1

    read Title

    M 1 Reply Last reply
    0
    • T test55555

      read Title

      M Offline
      M Offline
      monke fard
      wrote on last edited by monke fard
      #2

      @test55555

      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
               }
      }
      }
      
      BossCreeper48B 1 Reply Last reply
      0
      • M monke fard

        @test55555

        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
                 }
        }
        }
        
        BossCreeper48B Offline
        BossCreeper48B Offline
        BossCreeper48
        wrote on last edited by
        #3

        @ali00035_ Is this using API v1 orv 2?

        ? 1 Reply Last reply
        0
        • BossCreeper48B BossCreeper48

          @ali00035_ Is this using API v1 orv 2?

          ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          @bosscreeper48 its on scriptapi v2

          BossCreeper48B 1 Reply Last reply
          0
          • ? A Former User

            @bosscreeper48 its on scriptapi v2

            BossCreeper48B Offline
            BossCreeper48B Offline
            BossCreeper48
            wrote on last edited by
            #5

            @ender1355-0 ty

            ? 1 Reply Last reply
            0
            • BossCreeper48B BossCreeper48

              @ender1355-0 ty

              ? Offline
              ? Offline
              A Former User
              wrote on last edited by
              #6

              @bosscreeper48 np, btw you can check the LB ScriptAPI docs to learn more

              BossCreeper48B 1 Reply Last reply
              0
              • ? A Former User

                @bosscreeper48 np, btw you can check the LB ScriptAPI docs to learn more

                BossCreeper48B Offline
                BossCreeper48B Offline
                BossCreeper48
                wrote on last edited by
                #7

                @ender1355-0 yes thats what im doing rn

                ? 1 Reply Last reply
                0
                • BossCreeper48B BossCreeper48

                  @ender1355-0 yes thats what im doing rn

                  ? Offline
                  ? Offline
                  A Former User
                  wrote on last edited by
                  #8

                  @bosscreeper48 then you're good to go

                  BossCreeper48B 1 Reply Last reply
                  0
                  • ? A Former User

                    @bosscreeper48 then you're good to go

                    BossCreeper48B Offline
                    BossCreeper48B Offline
                    BossCreeper48
                    wrote on last edited by
                    #9
                    This post is deleted!
                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    About
                    • Terms of Service
                    • Privacy Policy
                    • Status
                    • Contact Us
                    Downloads
                    • Releases
                    • Source code
                    • License
                    Docs
                    • Tutorials
                    • CustomHUD
                    • AutoSettings
                    • ScriptAPI
                    Community
                    • Forum
                    • Guilded
                    • YouTube
                    • Twitter
                    • D.Tube
                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups