
“你不是在切换模式,你是在切换维度。”
2000 次下载?!谢谢!
1 功能特性
1.1 离线玩家
你可以更改玩家的生存模式(gamemode),即使他(或她)处于离线状态。
1.2 权限管理
允许权限组插件(如 Luckperms)管理可以切换到哪些生存模式以及不可以切换到哪些生存模式。
例如:允许切换到生存模式,但不允许切换到其他任何模式。
1.3 命令别名
/gamemode 被简化为 /gm 和 /g。
(当然,你仍然可以使用 /gamemode)
1.4 跨服务器存储
支持 MySQL 和 SQLite 存储后端。玩家的生存模式数据会在网络中的多个服务器之间保存并同步。
1.5 Folia 支持
完全兼容 Folia 服务器 —— 使用基于区域的调度以实现最佳性能。
1.6 轻量级
插件大小仅为 ~25 KB,对服务器性能的影响几乎为零!
2 注意事项
2.1 快捷键
如果你需要使用 F3+F4 等快捷键,请安装另一个插件 F3NPerm。
2.2 版本要求
1.8.X +
所有基于 Bukkit 的服务器(Paper, Spigot, Purpur, Folia 等)
3 命令
- /xgamemode
- /xgamemode reload
- /gm <mode>
- /gm <mode> <player>
- /gm <mode> -all
- /gm <mode> -online
- /gm <mode> -offline
/g = /gm = /gamemode
/xg = /xgm = /xgamemode
4 权限节点
- xgamemode.survival
- xgamemode.creative
- xgamemode.adventure
- xgamemode.spectator
- xgamemode.others.survival
- xgamemode.others.creative
- xgamemode.others.adventure
- xgamemode.others.spectator
- xgamemode.reload
- xgamemode.admin
5 自定义配置
5.1 基本设置
lang: en-US
语言设置
default_gamemode: survival
如果新玩家加入你的服务器,应该将他们设置为什么生存模式?
survival(生存)、creative(创造)、adventure(冒险)、spectator(旁观者)
show_logo: true
插件启用时是否显示 Logo。
true(是)、false(否)
debug: false
启用调试日志以进行故障排除。
true(是)、false(否)
5.2 存储配置
storage:
type: yaml
存储后端类型:yaml、sqlite、mysql
SQLite 示例
storage:
type: sqlite
# 无需额外配置 —— data.db 将自动创建
MySQL 示例
storage:
type: mysql
mysql:
host: localhost
port: 3306
database: minecraft
username: root
password: your_password
5.3 自定义消息
messages:
en-US: # Wind_Blood 提供的原始英文语言包
reloaded: "&aXGamemode Reloaded!"
# ......
custom_lang: # 添加你自己的自定义语言!
reloaded: "Thank you for using XGamemode!"
# ......
可自定义的消息。你可以在这里添加你自己的新语言!
5.4 一个 config.yml 示例
lang: msgForMyServer
default_gamemode: survival
show_logo: false
debug: false
storage:
type: yaml
messages:
msgForMyServer:
reloaded: "很明显作者是中国人 会说中文很正常 然后我也不知道为什么我要在一堆英文里写一段中文 挺好笑的 哈哈哈 对了 看到我就是缘分 XGamemode 官方 QQ 反馈交流群:点击链接加入群聊【XGamemode 反馈群】:https://qm.qq.com/q/rpTk5LK7w4 欢迎加"
usage: "&cUsage: /gm <mode> [player/-all/-online/-offline]"
console_usage: "&cUsage: /gm <mode> <player/-all/-online/-offline>"
invalid_gamemode: "&cInvalid Gamemode!"
invalid_player: "&cInvalid Player!"
gamemode_self: "&aYour Gamemode Changed to {mode}!"
gamemode_all: "&aChanged All Player's Gamemode to {mode}!"
gamemode_online: "&aAll Online Player's Gamemode Changed to {mode}!"
gamemode_offline: "&aAll Offline Player's Gamemode Changed to {mode}!"
no_permission: "&cYOU ARE NOT ALLOWED TO DO THAT!"
gamemode_other: "&a{player}'s Gamemode Changed to {mode}!"
gamemode_other_offline: "&a{player} (Offline)'s Gamemode Changed to {mode}!"
6 开发者 API (异步)
获取实例
Main plugin = Main.getInstance();
获取玩家生存模式
plugin.getPlayerMode(playerUUID).thenAccept(mode -> {
if (mode != null) {
// mode 为 GameMode.SURVIVAL, CREATIVE, ADVENTURE 或 SPECTATOR
// 玩家在线或拥有已保存的数据
} else {
// 未找到玩家或尚无已保存的生存模式数据
}
});
设置玩家生存模式
plugin.setPlayerMode(playerUUID, GameMode.SURVIVAL).thenAccept(success -> {
if (success) {
// 生存模式已成功更改并保存
// 适用于在线和离线玩家
} else {
// 保存失败(数据库错误等)
}
});
监听生存模式变更
@EventHandler
public void onGamemodeChange(GamemodeChangeEvent event) {
Player player = event.getPlayer(); // 仅限在线玩家
GameMode oldMode = event.getOldMode();
GameMode newMode = event.getNewMode();
}
注意: 所有 API 均为完全异步且线程安全。
GamemodeChangeEvent仅在玩家的模式实际发生更改时针对在线玩家触发。如果玩家没有已保存的生存模式数据,getPlayerMode()方法将返回null。
7 转载文章
hangar.papermc.io/Wind_Blood/XGamemode
modrinth.com/plugin/xgamemode
8 反馈
只需通过电子邮件联系我 windblood@foxmail.com。谢谢!

“You're not switching modes, you're switching dimensions.”
2000 Downloads?! Thanks!
1 Feature
1.1 Offline Player
You can change the gamemode of a player, even he (or she) was offline.
1.2 Permissions
Allow permission group plugins (like Luckperms) to manage which gamemodes can be switched to and which gamemodes cannot be switched to.
e.g. Allow to switch to survival mode but not to any other mode.
1.3 Alias
/gamemode is simplified to /gm and /g.
(of course you can still use /gamemode)
1.4 Cross-Server Storage
Support MySQL and SQLite storage backends. Player gamemodes are saved and synchronized across multiple servers in a network.
1.5 Folia Support
Fully compatible with Folia servers — using region-based scheduling for optimal performance.
1.6 Lightweight
The Plugin size is only ~25 KB and has almost no impact on server performance!
2 Caution
2.1 Shortcut Keys
If you need to use shortcut keys such as F3+F4, please install another plugin F3NPerm.
2.2 Versions
1.8.X +
All Bukkit based server (Paper, Spigot, Purpur, Folia, etc.)
3 Commands
- /xgamemode
- /xgamemode reload
- /gm <mode>
- /gm <mode> <player>
- /gm <mode> -all
- /gm <mode> -online
- /gm <mode> -offline
/g = /gm = /gamemode
/xg = /xgm = /xgamemode
4 Permission Node
- xgamemode.survival
- xgamemode.creative
- xgamemode.adventure
- xgamemode.spectator
- xgamemode.others.survival
- xgamemode.others.creative
- xgamemode.others.adventure
- xgamemode.others.spectator
- xgamemode.reload
- xgamemode.admin
5 Custom Config
5.1 Basic Settings
lang: en-US
Language setting
default_gamemode: survival
If a new player joined your server, which gamemode should he (she) be?
survival, creative, adventure, spectator
show_logo: true
Show logo or not when plugin enabled.
true, false
debug: false
Enable debug logging for troubleshooting.
true, false
5.2 Storage Configuration
storage:
type: yaml
Storage backend type: yaml, sqlite, mysql
SQLite Example
storage:
type: sqlite
# No additional config needed — data.db will be created automatically
MySQL Example
storage:
type: mysql
mysql:
host: localhost
port: 3306
database: minecraft
username: root
password: your_password
5.3 Custom Messages
messages:
en-US: # Original en-US Language by Wind_Blood
reloaded: "&aXGamemode Reloaded!"
# ......
custom_lang: # Add Your Custom Language!
reloaded: "Thank you for using XGamemode!"
# ......
Customizable Messages. You can add your own new language here!
5.4 An Example config.yml
lang: msgForMyServer
default_gamemode: survival
show_logo: false
debug: false
storage:
type: yaml
messages:
msgForMyServer:
reloaded: "很明显作者是中国人 会说中文很正常 然后我也不知道为什么我要在一堆英文里写一段中文 挺好笑的 哈哈哈 对了 看到我就是缘分 XGamemode 官方 QQ 反馈交流群:点击链接加入群聊【XGamemode 反馈群】:https://qm.qq.com/q/rpTk5LK7w4 欢迎加"
usage: "&cUsage: /gm <mode> [player/-all/-online/-offline]"
console_usage: "&cUsage: /gm <mode> <player/-all/-online/-offline>"
invalid_gamemode: "&cInvalid Gamemode!"
invalid_player: "&cInvalid Player!"
gamemode_self: "&aYour Gamemode Changed to {mode}!"
gamemode_all: "&aChanged All Player's Gamemode to {mode}!"
gamemode_online: "&aAll Online Player's Gamemode Changed to {mode}!"
gamemode_offline: "&aAll Offline Player's Gamemode Changed to {mode}!"
no_permission: "&cYOU ARE NOT ALLOWED TO DO THAT!"
gamemode_other: "&a{player}'s Gamemode Changed to {mode}!"
gamemode_other_offline: "&a{player} (Offline)'s Gamemode Changed to {mode}!"
6 Developer API (Async)
Get Instance
Main plugin = Main.getInstance();
Get Player Gamemode
plugin.getPlayerMode(playerUUID).thenAccept(mode -> {
if (mode != null) {
// mode is GameMode.SURVIVAL, CREATIVE, ADVENTURE, or SPECTATOR
// Player is online or has saved data
} else {
// Player not found or no saved gamemode yet
}
});
Set Player Gamemode
plugin.setPlayerMode(playerUUID, GameMode.SURVIVAL).thenAccept(success -> {
if (success) {
// Gamemode changed and saved successfully
// Works for both online and offline players
} else {
// Failed to save (database error, etc.)
}
});
Listen to Gamemode Changes
@EventHandler
public void onGamemodeChange(GamemodeChangeEvent event) {
Player player = event.getPlayer(); // Online player only
GameMode oldMode = event.getOldMode();
GameMode newMode = event.getNewMode();
}
Note: All APIs are fully async and thread-safe. The
GamemodeChangeEventis only fired for online players when their mode is actually changed. ThegetPlayerMode()method returnsnullif the player has no saved gamemode data.
7 Reprint Post
hangar.papermc.io/Wind_Blood/XGamemode
modrinth.com/plugin/xgamemode
8 Feedback
Just e-mail me with windblood@foxmail.com. Thanks!
下载 XGamemode
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 XGamemode
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 XGamemode
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 XGamemode
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 XGamemode
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 XGamemode
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 XGamemode
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 XGamemode
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 XGamemode
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 XGamemode
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
新增
- 可编辑的游戏模式名称 - 现在配置文件中存在类似
survival的键,你可以编辑游戏模式的名称。 - 忽略默认游戏模式节点 - 如果玩家拥有此权限,则不会对该玩家应用默认游戏模式。感谢 @不是阿风喵 提供的反馈!
更改
- (无)
修复
- (无)
移除
- (无)
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
插件
PacketEvents 是一款专为 Minecraft Java 版打造的协议库,旨在简化数据包的处理与传输。
插件
ExyliaPlugins 的库。
插件
通过对话框或铁砧界面帮助你的 Anthme
插件
重新定义服务器上的生物运输方式。使用高度可定制的口袋道具,安全地捕获、存储和释放任何实体。
插件
为基于 Spigot/Paper/Folia 的服务器添加对 Vivecraft 的支持
插件
用于绘制游戏内地图或在浏览器中随探索实时进行地图绘制的实时地图。
评论 0
登录后参与评分
还没有评论,来抢沙发吧