Skip to content

Add config option to suppress packetevents debug logging (off by default)#14

Merged
funkemunky merged 2 commits intomainfrom
copilot/fix-spam-processed-handshake
Feb 20, 2026
Merged

Add config option to suppress packetevents debug logging (off by default)#14
funkemunky merged 2 commits intomainfrom
copilot/fix-spam-processed-handshake

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 20, 2026

PacketEvents was hardcoded with debug(true), spamming logs with "Processed handshake" and "Transitioned null's decoder into STATUS state!" messages for every server ping/status check.

Changes

  • Anticheat.java: Added @ConfigSetting(path = "packetevents", name = "debug") field defaulting to false, and moved loadConfig() into onLoad() (before PacketEventsRegister.register()) so the config is available at PacketEvents initialization time.
  • PacketEventsRegister.java: Replaced hardcoded debug(true) with a config-driven value:
boolean debug = Anticheat.INSTANCE.getAnticheatConfig()
        .getBoolean("packetevents.debug", Anticheat.packetEventsDebug);
PacketEvents.setAPI(SpigotPacketEventsBuilder.build(Anticheat.INSTANCE,
        new PacketEventsSettings().debug(debug).fullStackTrace(true).kickIfTerminated(false)));

Debug logging is now off by default. Users can re-enable it by setting packetevents.debug: true in anticheat.yml. The @ConfigSetting annotation ensures the key is written to the config file on first run via ClassScanner.

Original prompt

This section details on the original issue you should resolve

<issue_title>Spam: Processed handshake </issue_title>
<issue_description>[11:55:27 INFO]: [packetevents] Processed handshake for /199.83.103.165:36813: STATUS / 1.7.2 (using ViaVersion)
[11:55:27 INFO]: [packetevents] Transitioned null's decoder into STATUS state!
[11:55:27 INFO]: [packetevents] Transitioned null's encoder into STATUS state!
[11:55:31 INFO]: [packetevents] Processed handshake for /199.83.103.165:35531: STATUS / 1.7.2 (using ViaVersion)
[11:55:31 INFO]: [packetevents] Transitioned null's decoder into STATUS state!
[11:55:31 INFO]: [packetevents] Transitioned null's encoder into STATUS state!
[11:55:36 INFO]: [packetevents] Processed handshake for /199.83.103.165:50605: STATUS / 1.7.2 (using ViaVersion)
[11:55:36 INFO]: [packetevents] Transitioned null's decoder into STATUS state!
[11:55:36 INFO]: [packetevents] Transitioned null's encoder into STATUS state!</issue_description>

<agent_instructions>Please create a configuration option to turn the log messages off from packetevents and keep it off by default</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@funkemunky > > This is not a bug. These messages simply indicate STATUS pings from the same external IP, most likely an automated scanner or bot checking the server list. No connection is actually attempted, and PacketEvents is correctly switching the pipeline into the STATUS state. It’s harmless and not caused by the plugin. > > is there any way to hide it tho

If it is caused by Kauri anticheat's shaded packetevents, then no. I can disable it in a future update.

However, I do not recommend using this project on a production environment. It is relegated to hobbyist development on my end, with the end goal of it being production stable.

If you want something usable out of the box, I recommend trying out GrimAC. If you want something that will actually remove the cheaters, you'll have to pony up for Polar.AC


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: funkemunky <30784509+funkemunky@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix spam issue in processed handshake logs Add config option to suppress packetevents debug logging (off by default) Feb 20, 2026
Copilot AI requested a review from funkemunky February 20, 2026 17:34
@funkemunky funkemunky marked this pull request as ready for review February 20, 2026 17:35
Copilot AI review requested due to automatic review settings February 20, 2026 17:35
@funkemunky funkemunky merged commit c60438c into main Feb 20, 2026
2 of 3 checks passed
@funkemunky funkemunky deleted the copilot/fix-spam-processed-handshake branch February 20, 2026 17:36
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a configuration option to control PacketEvents debug logging, which was previously hardcoded to true and causing log spam with messages about handshake processing and state transitions. The debug logging is now configurable and disabled by default.

Changes:

  • Added packetevents.debug configuration field with @ConfigSetting annotation, defaulting to false
  • Moved loadConfig() call to onLoad() to ensure config is available before PacketEvents initialization
  • Modified PacketEvents initialization to read debug setting from config instead of using hardcoded true value

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
Anticheat/src/main/java/dev/brighten/ac/Anticheat.java Added packetEventsDebug config field with @ConfigSetting annotation and called loadConfig() in onLoad() before PacketEvents registration
Anticheat/src/main/java/dev/brighten/ac/utils/PacketEventsRegister.java Changed from hardcoded debug(true) to reading packetevents.debug from config with fallback to Anticheat.packetEventsDebug

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

getLogger().info("Loading Anticheat...");
LibraryLoader.loadAll(INSTANCE);

loadConfig();
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The loadConfig() method is now called in both onLoad() (line 143) and onEnable() (line 160). The PR description mentions "moved loadConfig() into onLoad()" which suggests the call in onEnable() should have been removed. Consider removing the duplicate call from onEnable() unless there's a specific reason to reload the configuration between these two lifecycle phases.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spam: Processed handshake

3 participants