▶️ ЗАБЕРИ СВОИ 8 ПОДАРКОВ 🎁 ПРИ СОЗДАНИИ СВОЕГО МАЙНКРАФТ СЕРВЕРА
Плагины/AdvancedChat-AC
AdvancedChat-AC

AdvancedChat-AC

AdvancedChatv2 gives every player control over what they see in chat. They can silence the entire public chat, block specific players, view who they have ignored, and the server automatically stops advertising messages before they reach anyone

Оцените первым
10
0

AdvancedChat-AC

Version: 1.0.0  |  Author: Spy  |  API: Spigot / Paper 1.13 – 1.21+

AdvancedChat-AC gives every player control over what they see in chat. They can silence the entire public chat, block specific players, view who they have ignored, and the server automatically stops advertising messages before they reach anyone — all with no lag, no database, and no extra setup.


How It Works — Quick Overview

  • Chat Toggle — a player runs /chattoggle and from that point on, no public chat messages appear for them at all. They run it again and chat comes back. Their preference is saved and survives restarts.
  • Ignore — a player runs /ignore Steve and Steve's messages stop appearing for them personally. Steve sees nothing different — he can still chat normally; only the player who ignored him cannot see his messages. Running /ignore Steve again un-ignores him.
  • Ignore List/ignorelist prints every player name that person has ignored, sorted alphabetically.
  • Ad Filter — every message is checked against a word list and a domain extension list before it reaches anyone. If it matches, the sender gets a warning and the message is silently dropped. OPs can bypass this.

All of this happens on an async thread — the main server tick is never touched during a chat event.


Installation

  1. Place AdvancedChatv2.jar inside your server's plugins/ folder.
  2. Start or restart the server.
  3. Three files are generated automatically:
    • plugins/AdvancedChatv2/config.yml — all player-facing messages
    • plugins/AdvancedChatv2/block.yml — ad filter word list and domain extensions
    • plugins/AdvancedChatv2/playerdata.json — created on first save, stores toggle and ignore state

No database. No extra plugins. No configuration required to get started.


Commands

/chattoggle

FieldValue
Aliases/ctoggle, /tc
Permissionadvancedchat.toggle
Who can useAll players by default

What it does: Toggles whether the player sees public chat.

  • Chat is ON by default for every player. Running /chattoggle turns it OFF — they no longer receive any public chat messages from anyone.
  • Running /chattoggle again turns it back ON — they see chat normally again.
  • The player's own messages are not affected. They can still type and send; they just will not see incoming messages from others while toggled off.
  • This setting is saved to disk and persists across restarts, reconnects, and server crashes.
  • Toggle state is stored only for players who have turned it OFF — players with chat on use zero memory.

/ignore <player>

FieldValue
Aliases/unignore
Permissionadvancedchat.ignore
Who can useAll players by default
Tab-completeYes — suggests all currently online players

What it does: Hides or un-hides a specific player's chat messages from you. This is a personal toggle — it only affects what you see. The ignored player is never notified.

  • Running /ignore Steve once hides all of Steve's future chat messages from you.
  • Running /ignore Steve again brings his messages back.
  • Works on offline players — you can ignore someone who is not currently online. The name is resolved through Bukkit's offline player cache. If the player has never joined the server, the command tells you they were not found.
  • You cannot ignore yourself.
  • Each player's ignore list is stored individually. Ignoring Steve does not affect anyone else's view of Steve's messages — only yours.
  • When you un-ignore your last player and your ignore list becomes empty, the memory used by your list is freed immediately.

/ignorelist

FieldValue
Aliases/ilist, /ignoredlist
Permissionadvancedchat.ignore
Who can useAll players by default

What it does: Displays a formatted list of every player you are currently ignoring. Names are resolved from UUID to username using Bukkit's offline player cache — no extra lookups or delays. The list is sorted alphabetically.

If you are not ignoring anyone, a message tells you so and hints how to use /ignore.


Permissions

Permission nodeWhat it grantsWho has it by default
advancedchat.toggleUse /chattoggleAll players
advancedchat.ignoreUse /ignore and /ignorelistAll players
advancedchat.bypass.filterSend any message without ad-filter checksOPs only

Ad Filter

Every message sent in public chat is scanned before it reaches any player. The scan is done in-memory and adds no measurable overhead. There are three layers of detection:

1. Blocked Words (block.ymlblocked-words)

A list of plain text phrases. If any phrase appears anywhere inside the message (case-insensitive, substring match), the message is blocked.

Examples of what gets blocked with the defaults:

  • "discord.gg/myserver" — contains discord.gg
  • "Get FREE RANKS at our server!" — contains free ranks
  • "BUY NOW at our website" — contains buy now

2. Blocked Domain Extensions (block.ymlblocked-extensions)

A list of domain endings. Any word in the message that ends with one of these is treated as a URL and the message is blocked.

Examples:

  • "play.ourserver.net" — ends with .net
  • "visit shop.store for items" — ends with .store
  • "join us at coolserver.gg" — ends with .gg

3. IP Address Detection (always on)

Any text matching the pattern of an IPv4 address (x.x.x.x) is automatically blocked regardless of the lists.

Examples:

  • "connect to 192.168.1.1"
  • "ip: 10.0.0.1:25565"

What happens when blocked

The message is cancelled — no other player ever sees it. The sender receives the filter-blocked message. No one else is notified. Players with advancedchat.bypass.filter skip all three layers.


Configuration Files

config.yml — Messages

Every message the plugin sends to players. Use & colour codes.

messages:
  chat-disabled:      "&aChat has been &cdisabled&a. Use &f/chattoggle &ato re-enable."
  chat-enabled:       "&aChat has been &aenabled&a. You can now see public chat again."
  now-ignoring:       "&aYou are now ignoring &f{player}&a. Their messages will be hidden from you."
  no-longer-ignoring: "&aYou are no longer ignoring &f{player}&a. You can see their messages again."
  player-not-found:   "&cPlayer &f{player} &cwas not found or has never joined."
  ignore-self:        "&cYou cannot ignore yourself."
  ignore-usage:       "&eUsage: &f/ignore <player>"
  ignorelist-empty:   "&eYou are not ignoring anyone. Use &f/ignore <player> &eto ignore someone."
  ignorelist-header:  "&8&m----&r &eIgnored Players &7({size}) &8&m----"
  ignorelist-entry:   "&7- &f{player}"
  ignorelist-footer:  "&8&m----&r &7Use &f/ignore <player> &7to unignore &8&m----"
  filter-blocked:     "&cYour message was blocked — no advertising allowed."
  players-only:       "&cOnly players can use this command."
  no-permission:      "&cYou do not have permission to use this command."

Placeholders:

PlaceholderWorks in
{player}now-ignoring, no-longer-ignoring, player-not-found, ignorelist-entry
{size}ignorelist-header

Colour codes:

CodeColourCodeColour
&0Black&8Dark Gray
&1Dark Blue&9Blue
&2Dark Green&aGreen
&3Dark Aqua&bAqua
&4Dark Red&cRed
&5Dark Purple&dLight Purple
&6Gold&eYellow
&7Gray&fWhite
&lBold&oItalic
&mStrikethrough&nUnderline
&rReset&kObfuscated

block.yml — Ad Filter Words

blocked-words:
  - "discord.gg"
  - "buy now"
  - "free ranks"
  - "join my server"
  - "youtube.com"
  # add your own entries here

blocked-extensions:
  - ".com"
  - ".net"
  - ".org"
  - ".fun"
  - ".gg"
  - ".xyz"
  - ".io"
  - ".me"
  - ".store"
  - ".online"
  - ".site"
  - ".club"
  - ".tk"
  - ".ml"
  # add more endings here

Changes take effect after a server restart or plugin reload.


Data & Persistence

Player data is saved in plugins/AdvancedChatv2/playerdata.json:

{
  "chatDisabled": [
    "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"
  ],
  "ignored": {
    "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb": [
      "cccccccc-cccc-cccc-cccc-cccccccccccc"
    ]
  }
}
  • chatDisabled — UUIDs of players who toggled chat off. Players with chat on are not listed at all.
  • ignored — map of observer UUID → array of ignored UUIDs. Players with empty ignore lists are not listed at all.

When saves happen:

  • Player disconnects → async save off the main thread
  • Command used (toggle / ignore) → async save so state persists even if server crashes before next disconnect
  • Server shuts down → final synchronous save, no data lost

A serial counter ensures if multiple async saves queue up at the same time, only the newest snapshot is written. Old in-flight writes are discarded automatically.


RAM & CPU Usage

This section gives exact numbers for every operation the plugin performs so you know precisely what load it adds to your server.


Memory per player

What is storedBytes per entryNotes
One UUID in chatDisabled~64 bytesOnly stored if player toggled chat OFF
One entry in ignored map (outer)~64 bytesOnly created when player ignores someone
One UUID in an ignore list (inner)~64 bytesOne per ignored player
Player with no toggles or ignores0 bytesNothing is stored for inactive players

Real totals by server size:

Players online10% have chat disabled5% have ignore lists (avg 5 ignored each)Total plugin RAM
100 players10 × 64 B = 0.6 KB5 × 5 × 64 B = 1.6 KB~2.2 KB
500 players50 × 64 B = 3.1 KB25 × 5 × 64 B = 8 KB~11 KB
1,000 players100 × 64 B = 6.4 KB50 × 5 × 64 B = 16 KB~22 KB
10,000 players1,000 × 64 B = 64 KB500 × 5 × 64 B = 160 KB~224 KB

At any realistic player count the plugin uses well under 1 MB of RAM. The server itself, chunk data, entities, and other plugins will use gigabytes — this plugin is invisible by comparison.


CPU per chat message

Every chat message triggers two operations on the async thread (not the main tick):

Step 1 — Ad filter check

The message is checked against your blocked-words list and domain patterns.

OperationTime per callNotes
One String.contains() word check~20–50 nsScans the message for one phrase
One regex domain pattern check~500–1,000 nsMatches one domain extension
IP address regex check~500 nsAlways runs once
50 words + 20 extensions (typical config)~30–50 µs totalEntire filter check for one message

Step 2 — Recipient filtering

For each player who would receive the message, the plugin does two ConcurrentHashMap.get() lookups — one to check if they have chat disabled, one to check if they are ignoring the sender. Both are O(1) and take ~50–100 ns each.

Recipients onlineLookupsTime
50 players100 lookups~5–10 µs
200 players400 lookups~20–40 µs
500 players1,000 lookups~50–100 µs
1,000 players2,000 lookups~100–200 µs

Total per message (filter + recipient loop):

Players onlineTime per messageMessages per second (10 players chatting)CPU load
100~60 µs10 msg/s = 0.6 ms/s< 0.1% of one core
500~150 µs10 msg/s = 1.5 ms/s< 0.2% of one core
1,000~250 µs10 msg/s = 2.5 ms/s< 0.3% of one core

This entire workload runs on an async thread, isolated from the main server tick. Even if the filter takes longer than expected, TPS is completely unaffected.


Save operations

OperationThreadTimeFrequency
Snapshot copy (before async write)Main or quit thread~5–50 µsPer player quit or command
JSON write to diskAsync thread~1–5 msPer player quit or command
Shutdown saveMain thread~1–5 msOnce, on /stop

The JSON file is small — even with 10,000 players who all have ignore lists it is unlikely to exceed a few hundred KB. Write time remains under 5 ms. Because writes are async, the main thread is never blocked.


Memory & CPU summary

MetricValue
Plugin RAM at 500 players~11 KB
Plugin RAM at 1,000 players~22 KB
CPU per chat message (500 players)~150 µs, on async thread
Main thread impact during chatZero
Main thread impact during saveZero (async)
Disk I/O during gameplayZero
Performance compared to vanilla chatIndistinguishable

Folder Layout

plugins/
└── AdvancedChatv2/
    ├── config.yml          ← all player-facing messages
    ├── block.yml           ← ad filter words and domain extensions
    └── playerdata.json     ← auto-generated, do not edit manually

Часто задаваемые вопросы

Совместимость

Minecraft: Java Edition

26.2.x26.1.x1.21.x1.20.x1.19.x1.18.x1.17.x1.16.x1.15.x1.14.x1.13.x

Платформы

Поддерживаемые окружения

Сервер

Ссылки


Создатели

Детали

Лицензия:
Опубликован:1 месяц назад
Обновлён:1 месяц назад
Главная