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. Kotlin/Java
  3. Chat message detector and deleter

Chat message detector and deleter

Scheduled Pinned Locked Moved Kotlin/Java
6 Posts 5 Posters 360 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • XimatendrX Offline
    XimatendrX Offline
    Ximatendr
    wrote on last edited by
    #1

    How to detect any message from chat and how to delete it? I need it for some type of ignore function.

    Plumer ManP LarissaL 2 Replies Last reply
    0
    • Plumer ManP Offline
      Plumer ManP Offline
      Plumer Man
      replied to Ximatendr on last edited by
      #2

      read c02 message and cancel it if it meets your conditions

      XimatendrX 1 Reply Last reply
      0
      • XimatendrX Offline
        XimatendrX Offline
        Ximatendr
        replied to Plumer Man on last edited by
        #3

        Uhm, I didn't get it, how does c02 (packet use entity) relate to message detection?

        1 Reply Last reply
        0
        • A Offline
          A Offline
          Aftery
          wrote on last edited by
          #4
          This post is deleted!
          Ali00035A 1 Reply Last reply
          1
          • LarissaL Offline
            LarissaL Offline
            Larissa
            replied to Ximatendr on last edited by Larissa
            #5

            @ximatendr In the case of a lower version, may we need the detection of S02Packet?

            1 Reply Last reply
            5
            • Ali00035A Offline
              Ali00035A Offline
              Ali00035
              replied to Aftery on last edited by Ali00035
              #6

              Explaining it in the rudest way possible.

              1. Import the S02PacketChat as @Aftery and @Plumer-Man said.
              var S02PacketChat = Java.type("net.minecraft.network.play.server.S02PacketChat");
              
              1. Check if the packet is S02PacketChat as @Larissa said, add this in module.on("packet", function(e) {
              if (e.getPacket() instanceof S02PacketChat) { 
              
              1. In order to read the message, you need to add this variable in the same place.
              var Message = e.getPacket().getChatComponent().getUnformattedText();
              
              1. To check if the Message contains the string of your preference, you have to add this in the same place... again:
              if (Message.toLowerCase().contains("string of your preference")) {
              	e.cancelEvent();
              }
              // change the "string of your preference" to what you want.
              
              1 Reply Last reply
              2

              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