DisableCommand
作者:laowang
Disable any command via config file or in‑game gamerule – with multilingual feedback. Lightweight.
介绍
中文介绍正在准备中,下面暂时显示原文。
Disable Command is a lightweight NeoForge mod that lets server administrators block any command (or command prefix) on their server – without restarting and without client mods.
🔧 Features
- Configurable ban list – specify commands in
config/disablecommand-common.toml(e.g.,["tp::s", "gamemode creative::e", "kill::e"]). - In‑game toggle – use the gamerule
/gamerule disableCommandEnabled falseto temporarily disable the blocker (useful for maintenance or troubleshooting). - Server‑side only – install it on your NeoForge server; clients don’t need anything.
🎮 Usage
- Place the mod in your server’s
modsfolder. - Start the server – it will generate the config file.
- Edit
config/disablecommand-common.toml:
[commands]
disabledCommands = ["tp::s", "gamemode creative::e", "kill::e"]
(Optional) Reload or restart – changes apply immediately.
In game, run /gamerule disableCommandEnabled true to enable blocking, or false to disable it temporarily.
⚙️ Configuration
The config file contains:
disabledCommands – list of command strings (without the /). Uses prefix matching, so "gamemode" blocks /gamemode creative as well.
📦 Compatibility
Minecraft 1.21.1 – NeoForge 21.11.44 or later.
Works in single‑player (integrated server) and dedicated servers.
No dependencies.
常见问题
DisableCommand 支持哪些 Minecraft 版本?
DisableCommand 支持 Minecraft Java 版 1.21.1–1.21.11,共 11 个版本,可用的加载器:NeoForge。下载时注意选择和你游戏版本一致的文件。
DisableCommand 怎么安装?
先用 PCL2 或 HMCL 启动器安装对应版本的 NeoForge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。运行环境:仅服务端。
评论
登录后评论和评分