跳到正文

Discord Connect Templete

作者:yuthirime

A lightweight Minecraft mod that exposes API endpoints for seamless Discord integration.

收藏

截图

介绍

中文介绍正在准备中,下面暂时显示原文。

Discord Connect Template

Discord Connect Template is a server-side Minecraft Forge mod that sends Minecraft server and player events to a customizable Discord integration API.

This project is provided as a template for server administrators and developers who want to connect Minecraft with Discord using their own API implementation.

## Features

  • Sends server start and stop events
  • Sends player join and leave events
  • Sends periodic heartbeat events
  • Generates Discord account linking codes with /discord link
  • Supports English and Japanese in- game messages
  • Uses configurable API endpoints and authentication
  • Skips API requests when no API URL is configured

Configuration

The mod does not include a hosted API, database, database credentials, or private server configuration.

After starting the server once, edit the generated configuration file:

“text config/discord_connector- server.toml

Configure the following values:

server_id = “your-server-id”

api_url = “https://your-api.example.com“

api_key = “your-api-key”

``

The default configuration leaves api_url and api_key empty. API communication remains disabled until you provide your own compatible API.

In-Game Usage

Run the following command in Minecraft:

/discord link

The mod will generate a temporary linking code and display the Discord command to use:

/link code:YOUR_CODE

The linking code is valid for 10 minutes.

API Endpoints

A compatible API should implement the following endpoints:

  • POST /v1/minecraft/events/server- start
  • POST /v1/minecraft/events/server- stop
  • POST /v1/minecraft/events/join
  • POST /v1/minecraft/events/leave
  • POST /v1/minecraft/heartbeat
  • POST /v1/minecraft/link-code

The request and response formats are documented in the project source and README.

Important Notes

  • This mod does not provide a hosted API or database.
  • You are responsible for hosting and securing your own API.
  • Never publish API keys, database credentials, or private configuration files.
  • This mod is intended for server-side and client-side use.

License

See the included license file for usage and redistribution terms.

常见问题

Discord Connect Templete 支持哪些 Minecraft 版本?

Discord Connect Templete 支持 Minecraft Java 版 1.20.1–1.21.1,共 2 个版本,可用的加载器:Forge / NeoForge。下载时注意选择和你游戏版本一致的文件。

Discord Connect Templete 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 Forge / NeoForge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。

评论

登录后评论和评分