GuestViewer
一款 Minecraft 插件,将未列入白名单的玩家限制为旁观者模式并附加移动限制。

下载
稳定版本
下载最新稳定版本
开发版本
下载最新开发版本
⚠️ 您需要登录 GitHub 才能从 GitHub Actions 下载构建产物。
服务器兼容性
- 已在 Minecraft 1.21.x 上测试并正常运行
- 适用于 Paper/Spigot 服务器
功能
- 基于权限的白名单系统 - 没有
guestviewer.bypass 权限的玩家会自动被设置为旁观者模式
- 拥有
guestviewer.bypass 权限的玩家会自动被设置为生存模式
- 旁观者只能在距离其正在观看的玩家 100 格范围内移动
- 基于权限的世界重生点附近自由漫游(
guestviewer.freeroam)
- 除非拥有
guestviewer.chat 权限,否则旁观者无法使用聊天
- 可配置普通玩家和旁观者的欢迎消息
- 可配置普通玩家和旁观者的加入/离开广播消息
- 简单且轻量级
安装
- 从上述链接下载最新版本
- 将 JAR 文件放入服务器的
plugins 目录
- 重启服务器或运行
/reload
- 根据需要配置插件(参见配置部分)
用法
权限
guestviewer.bypass - 拥有此权限的玩家正常游玩(默认:op)
guestviewer.admin - 用于执行重载等管理命令(默认:op)
guestviewer.freeroam - 允许旁观者在距离世界重生点配置的范围内自由漫游(默认:false)
guestviewer.chat - 允许旁观者使用聊天(默认:false)
命令
/guestviewer 或 /gview - 显示插件信息
/guestviewer reload 或 /gview reload - 重新加载插件配置
配置
插件的配置存储在 plugins/GuestViewer/config.yml 中:
# 旁观者可以从其目标移动的最大距离(以方块为单位)
max-distance: 100
# 消息
messages:
# 当玩家加入并被设置为旁观者模式时显示的消息
spectator-join: "&c您不在白名单中!您已被设置为旁观者模式。"
# 当玩家加入并拥有 bypass 权限时显示的消息
player-join: "&a欢迎回来!您正在以生存模式游玩。"
# 当旁观者尝试超出最大距离移动时显示的消息
distance-warning: "&c您不能距离正在观看的玩家超过 100 格!"
# 当没有聊天权限的旁观者尝试聊天时显示的消息
chat-restricted: "&c您没有聊天权限。您处于旁观者模式。"
# 聊天设置
chat:
# 是否限制没有权限的旁观者的聊天功能
restrict-spectator-chat: true
# 广播通知
broadcast:
# 是否广播拥有 bypass 权限的玩家加入
player-join-enabled: true
player-join-message: "&e%player% &a已加入服务器。"
# 是否广播拥有 bypass 权限的玩家离开
player-quit-enabled: true
player-quit-message: "&e%player% &c已离开服务器。"
# 是否广播旁观者加入
spectator-join-enabled: true
spectator-join-message: "&7游客 &e%player% &7以旁观者身份加入。"
# 是否广播旁观者离开
spectator-quit-enabled: true
spectator-quit-message: "&7游客 &e%player% &7已离开服务器。"
工作原理
- 当玩家加入时,插件检查其是否拥有
guestviewer.bypass 权限
- 如果拥有该权限,则将其设置为生存模式
- 如果不拥有该权限,则将其设置为旁观者模式
- 旁观者被限制在距离其正在观看的玩家 100 格半径内(可配置)
- 拥有
guestviewer.freeroam 权限的旁观者可以在距离世界重生点配置的半径内移动
- 没有
guestviewer.chat 权限的旁观者无法使用聊天
- 如果他们尝试移动到允许的边界之外,他们会被传送回原位
支持
如果您遇到任何问题或有建议,请在 GitHub 仓库中提交 Issue。
许可证
本插件根据 MIT 许可证发布。
开发
从源码构建
该项目使用 Maven 进行构建自动化。要从源码构建:
mvn clean package
构建好的 JAR 文件将位于 target 目录中。
持续集成
本项目使用 GitHub Actions 自动构建插件。工作流程如下:
- 在每次推送到 main/master 分支以及拉取请求时构建插件
- 使用 JDK 21 进行编译
- 创建可以从 Actions 选项卡下载的构建产物
GuestViewer
A Minecraft plugin that restricts non-whitelisted players to spectator mode with movement limitations.

Download
Stable Version
Download Latest Stable Version
Bleeding Edge Version
Download Latest Bleeding Edge Version
⚠️ You will need to be logged into GitHub to download artifacts from GitHub Actions.
Server Compatibility
- Tested and working on Minecraft 1.21.x
- Should work on Paper/Spigot servers
Features
- Permission-based whitelist system - players without the
guestviewer.bypass permission are automatically set to spectator mode
- Players with the
guestviewer.bypass permission are automatically set to survival mode
- Spectators can only move within 100 blocks of the player they're spectating
- Permission-based free roaming near world spawn (
guestviewer.freeroam)
- Chat restriction for spectators unless they have the
guestviewer.chat permission
- Configurable welcome messages for both regular players and spectators
- Configurable join/leave broadcast messages for both regular players and spectators
- Simple and lightweight
Installation
- Download the latest release from the link above
- Place the JAR file in your server's
plugins directory
- Restart your server or run
/reload
- Configure the plugin as needed (see Configuration section)
Usage
Permissions
guestviewer.bypass - Players with this permission play normally (default: op)
guestviewer.admin - Required to use admin commands like reload (default: op)
guestviewer.freeroam - Allows spectators to roam freely within the configured distance of world spawn (default: false)
guestviewer.chat - Allows spectators to use the chat (default: false)
Commands
/guestviewer or /gview - Displays plugin info
/guestviewer reload or /gview reload - Reloads the plugin configuration
Configuration
The plugin's configuration is stored in plugins/GuestViewer/config.yml:
# Maximum distance (in blocks) a spectator can move from their target
max-distance: 100
# Messages
messages:
# Message shown to players when they join and are set to spectator mode
spectator-join: "&cYou are not whitelisted! You have been set to spectator mode."
# Message shown to players when they join and have the bypass permission
player-join: "&aWelcome back! You are playing in survival mode."
# Message shown when a spectator tries to move beyond the max distance
distance-warning: "&cYou cannot move more than 100 blocks from the player you are spectating!"
# Message shown when a spectator without chat permission tries to chat
chat-restricted: "&cYou don't have permission to chat. You are in spectator mode."
# Chat settings
chat:
# Whether to restrict chat for spectators without permission
restrict-spectator-chat: true
# Broadcast notifications
broadcast:
# Whether to broadcast when a player with bypass permission joins
player-join-enabled: true
player-join-message: "&e%player% &ahas joined the server."
# Whether to broadcast when a player with bypass permission leaves
player-quit-enabled: true
player-quit-message: "&e%player% &chas left the server."
# Whether to broadcast when a spectator joins
spectator-join-enabled: true
spectator-join-message: "&7Guest &e%player% &7has joined as a spectator."
# Whether to broadcast when a spectator leaves
spectator-quit-enabled: true
spectator-quit-message: "&7Guest &e%player% &7has left the server."
How it Works
- When a player joins, the plugin checks if they have the
guestviewer.bypass permission
- If they have the permission, they're set to survival mode
- If they don't have the permission, they're set to spectator mode
- Spectators are restricted to a 100-block radius (configurable) around the player they're spectating
- Spectators with the
guestviewer.freeroam permission can move within the configured radius of world spawn
- Spectators without the
guestviewer.chat permission cannot use the chat
- If they try to move beyond allowed boundaries, they're teleported back
Support
If you encounter any issues or have suggestions, please open an issue on the GitHub repository.
License
This plugin is released under the MIT License.
Development
Building from Source
The project uses Maven for build automation. To build from source:
mvn clean package
The built jar file will be in the target directory.
Continuous Integration
This project uses GitHub Actions to automatically build the plugin. The workflow:
- Builds the plugin on every push and pull request to main/master branches
- Uses JDK 21 for compilation
- Creates artifacts that can be downloaded from the Actions tab
评论 0
登录后参与评分
还没有评论,来抢沙发吧