> ## Documentation Index
> Fetch the complete documentation index at: https://docs.razebot.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Bridge Plugin

> Live two-way Minecraft â Discord bridge — relay chat, joins, deaths, and console.

# Bridge Plugin

> Live two-way Minecraft ↔ Discord bridge — relay chat, joins, deaths, and console.

## How it works

The bridge plugin runs on your Minecraft server and opens a persistent WebSocket connection to raze. Once connected, messages and events flow in real time between Minecraft and Discord in both directions.

## Setup

<Steps>
  <Step title="Generate your token">
    Run this in Discord — raze DMs you the plugin file and config:

    ```bash theme={null} theme={null}
    ;mc bridge plugin
    ```

    Requires **Administrator** in Discord.
  </Step>

  <Step title="Install the plugin">
    Drop `raze-bridge.jar` into your Minecraft server's `plugins/` folder and start the server once to generate the config file.
  </Step>

  <Step title="Configure the plugin">
    Stop the server, then edit `plugins/SlugBridge/config.yml`:

    ```yaml theme={null} theme={null}
    url: "ws://api.raze.lat/mc/bridge"
    token: "your-token-here"
    ```

    The token and URL are included in the DM from step 1.
  </Step>

  <Step title="Start the server">
    Start your Minecraft server. Run `;mc bridge` in Discord to verify the plugin is connected.
  </Step>
</Steps>

<Tip>
  Keep your token secret — anyone with it can send commands as your server. Use `;mc bridge rotate` to generate a new one if it's ever exposed.
</Tip>

## Check connection

```bash theme={null} theme={null}
;mc bridge
```

Shows whether the plugin is connected and which channels are configured.

## Route events to channels

Forward Minecraft events to Discord channels.

<CodeGroup>
  ```bash Set theme={null} theme={null}
  ;mc bridge channel (event) (#channel)
  ```

  ```bash Unset theme={null} theme={null}
  ;mc bridge unset (event)
  ```

  ```bash Example theme={null} theme={null}
  ;mc bridge channel chat #minecraft-chat
    ;mc bridge channel joins #server-log
    ;mc bridge channel deaths #server-log
    ;mc bridge channel console #mc-console
  ```
</CodeGroup>

<ParamField path="event" type="chat | joins | deaths | console" required>
  The Minecraft event to forward.

  <Expandable title="events">
    <ResponseField name="chat">Player chat messages appear in the Discord channel.</ResponseField>
    <ResponseField name="joins">Join and leave notifications.</ResponseField>
    <ResponseField name="deaths">Player death messages.</ResponseField>
    <ResponseField name="console">Full server console output. Use a private channel.</ResponseField>
  </Expandable>
</ParamField>

## Send messages & commands

<Tabs>
  <Tab title="Say (chat)">
    ```bash theme={null} theme={null}
    ;mc bridge say (message)
    ```

    Sends a message into in-game chat as yourself. Requires **Manage Messages**.
  </Tab>

  <Tab title="Execute (command)">
    ```bash theme={null} theme={null}
    ;mc bridge execute (command)
    ```

    Runs a raw server command through the bridge. Requires **Administrator**.
  </Tab>

  <Tab title="Example">
    ```bash theme={null} theme={null}
    ;mc bridge say Hello from Discord!
    ;mc bridge execute time set day
    ```
  </Tab>
</Tabs>

## Rotate token

Invalidates the current plugin token and generates a new one. Use this if your token is ever leaked.

```bash theme={null} theme={null}
;mc bridge rotate
```

<Warning>
  After rotating, you must update `config.yml` on your Minecraft server with the new token and restart it.
</Warning>
