Skip to content

Discord Integration

Kole edited this page Oct 4, 2026 · 1 revision

Discord Integration

Defixus has two independent Discord integrations. Both are disabled by default. A Discord webhook URL is a secret: do not publish it in issue reports, screenshots, logs, or version control.

Event notifications

Configure config/Defixus-anticheat/discord/webhook.json. The top-level enabled switch and the individual event's enabled flag must both be true; the event also needs a non-empty URL.

Supported event keys:

Event key Notifications
player_join Successful player joins
operator_join Operator/moderator verification bypass
operator_change Operator permission grants/removals
command_dispatch Selected player-issued commands
player_kick Verification kicks
mod_warnings Unapproved/modified mod warnings
pack_warnings Unapproved/modified pack warnings
pack_changes Resource-pack change records
server_start Server startup
server_stop Server shutdown

Example structure:

{
  "enabled": true,
  "fancy-webhooks": false,
  "command_tracking": {
    "enabled": true,
    "commands": {
      "gamemode": "https://discord.com/api/webhooks/REDACTED_1",
      "give": "https://discord.com/api/webhooks/REDACTED_2"
    }
  },
  "events": {
    "player_join": {"enabled": true, "url": "https://discord.com/api/webhooks/REDACTED_3"}
  }
}

Use actual generated webhook URLs in the server config; REDACTED_i is only a placeholder. For command notifications, all three conditions must hold: global enabled, command_tracking.enabled, and events.command_dispatch.enabled. Only command names in command_tracking.commands are tracked. A command entry with an empty URL uses the general command_dispatch URL; a non-empty URL routes that command separately. Command alerts cover player-issued commands, not arbitrary console commands.

fancy-webhooks defaults to false. When enabled, eligible event messages add extra player statistics and/or hash details. Discord event language comes from verification/settings.json; a client's language preference does not set Discord's language. Event configuration is loaded at startup; restart after changing it.

Legacy Discord config and command-name arrays are migrated on load. Existing valid configurations are normalized and saved. Back up the file before manual changes.

Runtime console forwarding

Configure config/Defixus-anticheat/console/discord-webhook.json separately:

{
  "enabled": false,
  "webhook-url": ""
}

The URL must be an HTTPS Discord webhook URL on discord.com or discordapp.com with an /api/webhooks/ path. Forwarding begins at server startup, sends Log4j INFO and higher messages (including exceptions), uses a bounded queue, and limits delivery to one message every two seconds. DEBUG and TRACE are not forwarded. Restart the server after changing this config.

Logs can contain usernames, chat/command details, local file paths, and exception data from Minecraft or other mods. Use a private, access-controlled Discord channel and inform server staff/community as appropriate. Do not enable forwarding to a public channel.

Troubleshooting

  • Confirm the global and event switches are enabled and the selected event URL is non-empty.
  • Confirm command tracking is enabled at all three levels and the command name is listed without /.
  • Use a valid HTTPS Discord webhook URL and verify the Discord channel still exists.
  • Check the server log for HTTP errors; do not paste webhook URLs into a public report.
  • Event-webhook changes need a server restart; runtime console forwarding also needs a restart.

Clone this wiki locally