<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Chat message detector and deleter]]></title><description><![CDATA[<p dir="auto">How to detect any message from chat and how to delete it? I need it for some type of ignore function.</p>
]]></description><link>https://forum.liquidbounce.net/topic/4392/chat-message-detector-and-deleter</link><generator>RSS for Node</generator><lastBuildDate>Mon, 18 May 2026 00:11:17 GMT</lastBuildDate><atom:link href="https://forum.liquidbounce.net/topic/4392.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 24 Aug 2022 07:46:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Chat message detector and deleter on Sat, 27 Aug 2022 17:09:22 GMT]]></title><description><![CDATA[<p dir="auto">Explaining it in the rudest way possible.</p>
<ol>
<li>Import the S02PacketChat as <a class="plugin-mentions-user plugin-mentions-a" href="/user/aftery" aria-label="Profile: Aftery">@<bdi>Aftery</bdi></a> and <a class="plugin-mentions-user plugin-mentions-a" href="/user/plumer-man" aria-label="Profile: Plumer-Man">@<bdi>Plumer-Man</bdi></a> said.</li>
</ol>
<pre><code>var S02PacketChat = Java.type("net.minecraft.network.play.server.S02PacketChat");
</code></pre>
<ol start="2">
<li>Check if the packet is S02PacketChat as <a class="plugin-mentions-user plugin-mentions-a" href="/user/larissa" aria-label="Profile: Larissa">@<bdi>Larissa</bdi></a> said, add this in <code>module.on("packet", function(e) {</code></li>
</ol>
<pre><code>if (e.getPacket() instanceof S02PacketChat) { 
</code></pre>
<ol start="3">
<li>In order to read the message, you need to add this variable in the same place.</li>
</ol>
<pre><code>var Message = e.getPacket().getChatComponent().getUnformattedText();
</code></pre>
<ol start="4">
<li>To check if the Message contains the string of your preference, you have to add this in the same place... again:</li>
</ol>
<pre><code>if (Message.toLowerCase().contains("string of your preference")) {
	e.cancelEvent();
}
// change the "string of your preference" to what you want.
</code></pre>
]]></description><link>https://forum.liquidbounce.net/post/33095</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/33095</guid><dc:creator><![CDATA[Ali00035]]></dc:creator><pubDate>Sat, 27 Aug 2022 17:09:22 GMT</pubDate></item><item><title><![CDATA[Reply to Chat message detector and deleter on Sat, 27 Aug 2022 14:47:54 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ximatendr" aria-label="Profile: ximatendr">@<bdi>ximatendr</bdi></a> In the case of a lower version, may we need the detection of S02Packet?</p>
]]></description><link>https://forum.liquidbounce.net/post/33088</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/33088</guid><dc:creator><![CDATA[Larissa]]></dc:creator><pubDate>Sat, 27 Aug 2022 14:47:54 GMT</pubDate></item><item><title><![CDATA[Reply to Chat message detector and deleter on Wed, 24 Aug 2022 08:29:16 GMT]]></title><description><![CDATA[<p dir="auto">Uhm, I didn't get it, how does c02 (packet use entity) relate to message detection?</p>
]]></description><link>https://forum.liquidbounce.net/post/33017</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/33017</guid><dc:creator><![CDATA[Ximatendr]]></dc:creator><pubDate>Wed, 24 Aug 2022 08:29:16 GMT</pubDate></item><item><title><![CDATA[Reply to Chat message detector and deleter on Wed, 24 Aug 2022 08:12:54 GMT]]></title><description><![CDATA[<p dir="auto">read c02 message and cancel it if it meets your conditions</p>
]]></description><link>https://forum.liquidbounce.net/post/33015</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/33015</guid><dc:creator><![CDATA[Plumer Man]]></dc:creator><pubDate>Wed, 24 Aug 2022 08:12:54 GMT</pubDate></item></channel></rss>