Skip to content

v0.1.0 Documentation

TheFloatingPixel edited this page Sep 25, 2022 · 2 revisions

NOTE: THIS PAGE IS OUTDATED, AND ONLY APPLICABLE TO VERSION 0.1.0 OF THE PLUGIN

This is the documentation for version 0.1.0 (old parameter syntax). For the newest documentation, go here

Setup

  1. Download plugin and add it into the plugins folder

  2. Run server to create the plugin config file

  3. Open discord and go to the channel that you want the events to be logged to

  4. Open the channel settings

    obraz

  5. Go to 'Integrations'

    obraz

  6. Click the 'Create Webhook' button and name your webhook whatever you want

    obraz

  7. Press the 'Copy Webhook Url' button and paste the url under the 'webhooks' section in the config file

    obraz

    Your config file should now look something like this

    webhooks:
      - https://discord.com/api/webhooks/id/token

Aaand the setup is done! You can now further customize DiscordLog by looking into the next section.

Config File

This section explains all the options available in the DiscordLog config file.

webhooks

A list of all the discord webhooks to log the events to. DiscordLog supports multiple webhooks in a single server.

Example:

  webhooks:
    - https://discord.com/api/webhooks/id/token
    - https://discord.com/api/webhooks/id2/token2

logged-events

A list of all the events to log. Accepted list elements are

  • player-command-execution
  • console-command-execution
  • player-join
  • player-disconnect
  • player-kick
  • player-death
  • player-respawn
  • player-kill-entity
  • player-kill-named-entity

Warning

If both player-kill-entity and player-kill-named-entity are on the list, when a named mob dies both events will be logged!

Example:

  logged-events:
  - player-command-execution
  - console-command-execution
  - player-join
  - player-disconnect
# - player-kick  This line is commented out, so the plugin will not log players being kicked from the server
  - player-death
  - player-respawn
  - player-kill-entity
  - player-kill-named-entity

messages

A section containing all the log message formats (they can contain discord markdown!). The values in this section are

  • player-command - connected to player-command-execution event. First %s represents player, second - the command that was sent.

  • console-command - connected to console-command-execution event. %s represents the command that was sent.

  • player-join - connected to player-join event. %s represents the player.

  • player-disconnect - connected to player-disconnect event. %s represents the player.

  • player-kick - connected to player-kick event. %s represents the player.

  • player-death - connected to player-death event. %s represents the player.

  • player-respawn - connected to player-respawn event. %s represents the player.

  • player-kill-entity - connected to player-kill-entity event. First %s represents the player, second - the entity type.

  • player-kill-named-entity - connected to player-kill-named-entity event. First %s represents the player, second - the entity type, and third - the entity name

Example:

  messages:
     player-command: Player **%s** executed the command `%s`
     console-command: CONSOLE executed the command `%s`
     player-join: Player **%s** joined the server!
     player-disconnect: Player **%s** disconnected from the server.
     player-kick: Player **%s** was kicked from the server!
     player-death: Player **%s** died!
     player-respawn: Player **%s** respawned.
     player-kill-entity: Player **%s** killed entity of type **%s**
     player-kill-named-entity: Player **%s** killed entity of type **%s**, named **%s**

Commands

discordlog

Syntax: discordlog ( info | reload-config | test-webhooks )

Subcommands:

  • info

    Displays information about the plugin

  • reload-config

    Reloads the plugin config file

  • test-webhooks

    Sends a test message to all webhooks

Permissions

  • discordlog.reloadconfig - grants access to /discordlog reload-config

  • discordlog.testwebhooks - grants access to /discordlog test-webhooks