Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • 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 1.7k Views 1 Watching
  • 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.
  • 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
    • XimatendrX Ximatendr

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

      Plumer ManP Offline
      Plumer ManP Offline
      Plumer Man
      wrote on last edited by
      #2

      read c02 message and cancel it if it meets your conditions

      XimatendrX 1 Reply Last reply
      0
      • Plumer ManP Plumer Man

        read c02 message and cancel it if it meets your conditions

        XimatendrX Offline
        XimatendrX Offline
        Ximatendr
        wrote 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
          • XimatendrX Ximatendr

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

            LarissaL Offline
            LarissaL Offline
            Larissa
            wrote 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
            • A Aftery

              This post is deleted!

              Ali00035A Offline
              Ali00035A Offline
              Ali00035
              wrote 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

              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
              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