1.3.0
Compatibility
Changes
🎉 重大更新 修复了输出中文乱码的问题 双命令系统:同时支持 CMD 和 PowerShell 命令执行 管理员权限模式:新增 cmdadmin 和 psadmin 命令,支持以管理员权限运行 完全移除白名单限制:所有玩家都可以使用基础命令功能 多语言支持:新增 11 种语言本地化支持 🆕 新增功能 CMD 命令:/cmd <command> - 执行普通 CMD 命令 PowerShell 命令:/ps <command> - 执行 PowerShell 命令 管理员 CMD:/cmdadmin <command> - 以管理员权限执行 CMD 命令 管理员 PowerShell:/psadmin <command> - 以管理员权限执行 PowerShell 命令 输出长度限制:单次输出最多 10000 字符 分页显示:自动分段显示长输出(每 10 行) 执行超时控制:命令执行最长 30 秒超时 频率限制:每个玩家 1 秒内最多执行 1 次命令 特殊字符转义:自动转义特殊字符(& | < > ( ))防止命令注入 实时输出流:支持实时输出命令执行结果 🔒 安全增强 移除硬编码白名单机制 新增频率限制防止命令滥用 命令参数安全过滤和转义 输出长度限制防止内存溢出 🌍 多语言支持 简体中文 (zh_cn) 英语 (en_us) 日语 (ja_jp) 韩语 (ko_kr) 西班牙语 (es_es) 法语 (fr_fr) 德语 (de_de) 意大利语 (it_it) 葡萄牙语 (pt_br) 俄语 (ru_ru) 🐛 Bug 修复 修复 Lambda 表达式中引用非最终变量的编译错误 修复输出流缓冲处理问题 修复 UTF-8 编码导致的中文乱码问题 📝 技术改进 优化命令执行流程 改进错误处理和日志记录 重构输出显示逻辑,提升可读性 使用 ConcurrentHashMap 实现线程安全的频率限制 🎮 权限系统 /cmd 和 /ps - 权限等级 0(所有玩家可用) /cmdadmin 和 /psadmin - 权限等级 4(管理员专用) [1.9.x] - 历史版本 功能特性 基础 CMD 命令执行 白名单机制限制玩家使用 单语言支持 基础输出显示 📦 下载与安装 系统要求 Minecraft 1.20.1 Fabric Loader 0.14.21+ Java 17+ 安装步骤 下载 mc2cmd-1.10.0.jar 文件 将文件放入 Minecraft 服务器的 mods 目录 重启服务器 权限配置 默认情况下: 所有玩家可使用 /cmd 和 /ps 命令 仅管理员可使用 /cmdadmin 和 /psadmin 命令 可通过服务器权限插件调整权限等级。 📄 使用示例 基础 CMD 命令 /cmd dir /cmd ping 127.0.0.1 /cmd echo Hello World 基础 PowerShell 命令 /ps Get-Process /ps Get-Service /ps Test-Connection google.com 管理员 CMD 命令 /cmdadmin ipconfig /flushdns /cmdadmin net user administrator /active:yes 管理员 PowerShell 命令 /psadmin Restart-Service "MinecraftServer" /psadmin Set-ExecutionPolicy RemoteSigned ⚠️ 注意事项 安全性:开放 CMD/PowerShell 执行存在安全风险,请确保在可信环境中使用 权限管理:建议通过权限插件限制管理员命令的使用 输出限制:超长输出会被自动截断 超时控制:长时间运行的命令会在 30 秒后被强制终止 频率限制:过于频繁的命令执行会被拒绝 🐛 问题反馈 如遇到问题或发现 Bug,请在以下渠道反馈: GitHub Issues 官方 Discord 服务器 模组发布页面评论区 📄 开源协议 本模组采用 MIT 协议开源。 🙏 致谢 感谢所有测试用户的反馈和建议! 🎉 Major update The issue of outputting Chinese messy codes has been fixed Dual command system: Supports both CMD and PowerShell command execution Administrator Privilege Mode: Added cmdadmin and psadmin commands, supporting running with administrator privileges Fully remove whitelist restrictions: all players can use basic command functions Multi-language support: Added localization support for 11 new languages 🆕 New features CMD command: /cmd <command> - Execute a regular CMD command PowerShell command: /ps <command> - execute PowerShell command Administrator CMD: /cmdadmin <command> - Execute the CMD command with administrator privileges Administrator PowerShell: /psadmin <command> - Execute PowerShell command with administrator privileges Output length limit: Maximum 10,000 characters per output Paginated display: Automatically display long output in segments (every 10 lines) Implement timeout control: The command execution timeout is limited to a maximum of 30 seconds Frequency limit: Each player can execute a command at most once per second Special character escaping: Automatically escapes special characters (& | < > ( )) to prevent command injection Real-time output stream: Supports real-time output of command execution results 🔒 Security enhancement Remove the hardcoded whitelist mechanism New frequency restrictions to prevent command abuse Command parameter security filtering and escaping Output length limitation prevents memory overflow 🌍 Multi-language support Simplified Chinese (zh_cn) English (en_us) Japanese (ja_jp) Korean (ko_kr) Spanish (es_es) French (fr_fr) German (de_de) Italian (it_it) Portuguese (pt_br) Russian (ru_ru) 🐛 Bug fixes Fix the compilation error of referencing non-final variables in Lambda expressions Fix the issue with output stream buffering Fix the issue of Chinese garbled text caused by UTF-8 encoding 📝 Technical Improvement Optimize the command execution process Improve error handling and logging Refactor the output display logic to enhance readability Implement thread-safe frequency limiting using ConcurrentHashMap 🎮 Permission system /cmd and /ps - Permission level 0 (available to all players) /cmdadmin and /psadmin - Privilege Level 4 (Exclusively for Administrators) [1.9.x] - Historical Versions Features Basic CMD command execution Whitelist mechanism restricts player usage Single language support Basic output display 📦 Download and Installation system requirements Minecraft 1.20.1 Fabric Loader 0.14.21+ Java 17+ Installation steps Download the mc2cmd-1.10.0.jar file Place the file into the mods directory of the Minecraft server Restart the server Permission Configuration By default: All players can use the /cmd and /ps commands Only administrators can use the /cmdadmin and /psadmin commands The permission level can be adjusted through the server permission plugin. 📄 Usage example Basic CMD commands /cmd dir /cmd ping 127.0.0.1 /cmd echo Hello World Basic PowerShell commands /ps Get-Process /ps Get-Service /ps Test-Connection google.com Administrator CMD command /cmdadmin ipconfig /flushdns /cmdadmin net user administrator /active:yes Administrator PowerShell command /psadmin Restart-Service "MinecraftServer" /psadmin Set-ExecutionPolicy RemoteSigned ⚠️ Precautions Safety: Opening CMD/PowerShell execution poses security risks. Please ensure to use it in a trusted environment Permission management: It is recommended to restrict the use of administrator commands through a permission plugin Output limitation: Excessively long output will be automatically truncated Timeout control: Long-running commands will be forcibly terminated after 30 seconds Frequency limit: Execution of commands that are too frequent will be rejected 🐛 Feedback If you encounter any issues or discover any bugs, please provide feedback through the following channels: GitHub Issues Official Discord server Comment section of the module release page 📄 Open source license This module is open-sourced under the MIT License. 🙏 Acknowledgements Thank you to all test users for your feedback and suggestions!
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle. To learn more about the Modrinth Maven API, click here.
Note: When available, you should use the creator's maven repo instead as it will have transitive dependency information that the Modrinth Maven API does not. You may also end up with duplicate dependencies if you use a mix of Modrinth and non-Modrinth Maven repositories for your dependencies, because the group identifier will be different when served through the Modrinth Maven API.
Maven coordinates:
Version ID:
build.gradle:
repositories {
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
// forRepositories(fg.repository) // Uncomment when using ForgeGradle
filter {
includeGroup "maven.modrinth"
}
}
}
// Standard Gradle dependency
dependencies {
implementation "maven.modrinth:xqYURkYp:Gv80q4z7"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:xqYURkYp:Gv80q4z7"
}

