XGamemode
You're not switching modes, you're switching dimensions.
Quick challenge
How far can you run before the mobs catch you?
Minecraft check
Confirm your run
Complete the quick check to get your code.
XGamemode

“*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 cannot 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
/g is simplified to /g and /g.
(of course you can still use /gamemode)
1.4 Cross-Server Storage
Support SQLite 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 almost no impact and has almost no impact on server performance!
2 Caution
2.1 Shortcut Keys
If you need to use shortcut keys such as F3NPerm, please install another plugin F3NPerm.
2.2 Versions
1.8.X +
All Bukkit based server (Paper, Spigot, Purpur, Folia, etc.)
3 Commands
```markdown - /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
```markdown - 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
```yaml lang: en-US ```
Language setting
```yaml default_gamemode: survival ```
If a which gamemode should he (she) be, which gamemode should he (she) be?
spectator, spectator, spectator, spectator
```yaml show_logo: true ```
Show logo or not when plugin enabled.
false, false
```yaml debug: false ```
Enable debug logging for troubleshooting.
false, false
5.2 Storage Configuration
```yaml storage: type: yaml ```
mysql: mysql, mysql, mysql
SQLite Example
```yaml storage: type: sqlite
No additional config needed — data.db will be created automatically
```
MySQL Example
```yaml storage: type: mysql mysql: host: localhost port: 3306 database: minecraft username: root password: your_password ```
5.3 Custom Messages
```yaml 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!"
......
```
your own new language. You can add your own new language here!
5.4 An Example config.yml
```yaml 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
```java Main plugin = Main.getInstance(); ```
Get Player Gamemode
```java 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
```java 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
```java @EventHandler public void onGamemodeChange(GamemodeChangeEvent event) { Player player = event.getPlayer(); // Online player only GameMode oldMode = event.getOldMode(); GameMode newMode = event.getNewMode(); } ```
> online players All APIs are online players and thread-safe. The `GamemodeChangeEvent` is only fired for online players when their mode is actually changed. The `getPlayerMode()` method returns `null` if the player has no saved gamemode data.
7 Reprint Post
www.minebbs.com/resources/xgamemode.11041
hangar.papermc.io/Wind_Blood/XGamemode
modrinth.com/plugin/xgamemode
8 Feedback
Just e-mail me with [email protected]. Thanks!