Incognito
Incognito 是一款适用于 Paper 和 Folia 的 Minecraft 插件,允许玩家使用随机别名隐藏其身份。它会对发送给客户端的数据中的名称和皮肤进行掩码处理,并偏移可见的世界坐标。管理员可以管理玩家的隐身设置,并在身份变更时接收通知。
功能特性
- 每次启用隐身登录时生成一个随机别名,该别名会显示在个人资料、玩家列表和姓名标签中。
- 对聊天、记分板、Boss 栏、全息图以及其他插件发送的支持文本中的名称进行掩码处理。
- 对其他查看者隐藏皮肤或使用统一的替换皮肤。玩家自己仍能看到自己的皮肤。
- 对背包、装备、掉落物以及已放置方块中的玩家头颅进行掩码处理。原始物品配置文件仍保留在服务器上。
- 在隐身状态生效期间,书籍将以玩家的别名署名。
- 在世界视图、F3 调试屏幕、小地图和支持文本中应用 X/Z 坐标偏移。在支持的命令中输入的坐标会被转换回服务器实际坐标。
- 支持通过玩家偏好设置或服务器规则来控制加入和离开消息的显示。
- 包含真实姓名和别名的管理员通知。
- 可选集成 PlaceholderAPI 和 MiniPlaceholders,支持 SQLite、MySQL 或 PostgreSQL 存储。
要求与安装
该项目默认基于 Paper API 1.21.8 构建,并针对 Java 21 进行了优化。Folia 支持已在插件元数据中声明。由于数据包过滤使用了服务器内部类,因此在部署前请验证与其他 Minecraft 版本的兼容性。
- 构建项目或获取打包好的
Incognito-v<version>.jar 文件。
- 将 JAR 文件放入服务器的
plugins 目录,然后重启服务器。
- 编辑
plugins/Incognito/config.yml,并为玩家授予 incognito.use 权限。
- 配置更改后重启服务器。缺失的配置键将在启动时自动添加。
PlaceholderAPI 和 MiniPlaceholders 为可选组件。数据库库通过服务器的库机制加载。该插件还使用 bStats 指标,由服务器的 bStats 设置控制。
使用隐身功能
/incognito 用于保存请求的状态。启用和禁用保护将在玩家断开连接并重新登录后生效,即使禁用了坐标掩码也是如此。玩家会收到一条待处理的更改消息;插件不会自动断开他们的连接以应用此更改。
/incognito status 显示当前活动的别名、禁用状态或待处理的更改。如果在断开连接前再次切换,则取消待处理的更改。别名会在登录过程中生成。
命令与权限
命令别名:/incog。
| 命令 |
操作 |
/incognito |
切换请求的隐身状态。 |
/incognito on / /incognito off |
请求启用或禁用隐身。 |
/incognito status |
显示当前的保护状态。 |
/incognito messages |
在隐身状态生效期间,切换玩家自身加入和离开消息的可见性。 |
/incognito messages on / /incognito messages off |
将这些消息设置为显示或隐藏。 |
/incognito messages status |
显示有效设置以及更改是否被锁定。 |
/incognito player <player> [on|off] |
更改在线玩家的状态;如果省略 on/off,则进行切换。 |
| 权限 |
默认值 |
用途 |
incognito.use |
OP |
访问命令及个人隐身设置。 |
incognito.admin |
OP |
管理其他玩家并接收隐身状态和别名通知。管理命令还需要 incognito.use 权限。 |
incognito.reveal |
OP |
通过 incognito_realname 占位符查看真实姓名。普通名称掩码仍然保持活动状态。 |
个人设置需要由玩家发送者执行。控制台可以使用 player 子命令。当 names.hide_realname: true 时,通过别名来定位目标隐身玩家。
加入与离开消息
join-quit:
mode: player
default-show: true
allow-toggle: true
| 设置项 |
行为 |
mode: player |
使用每个玩家保存的偏好设置,或者在他们做出选择之前使用 default-show 的值。 |
mode: show |
强制显示消息并阻止玩家更改。 |
mode: hide |
强制隐藏消息并阻止玩家更改。 |
default-show |
player 模式下的初始设置:true 显示消息,false 隐藏消息。 |
allow-toggle: false |
在 player 模式下锁定更改,同时保留已保存的偏好设置以及没有偏好设置的玩家的默认值。 |
偏好设置控制关于该玩家的加入和离开公告,所有人在聊天中都能看到。它保存在数据库中,可以在启用隐身之前设置。它在保护生效期间的后续加入和离开事件中适用。没有启用隐身的玩家的消息仍由服务器控制。
当显示消息时,如果启用了 names.enabled 和 names.mask-system-messages,插件会保留事件消息并对玩家名称进行掩码处理。在 show 模式下,如果消息之前已被清除,它会提供 messages.join-message 或 messages.quit-message。在 player 模式下,会保留由其他插件导致的抑制情况。这些规则控制标准的加入和离开事件;其他插件直接发送的单独广播不在其范围内。稍后修改事件的另一个监听器可能会改变结果。
管理员通知
拥有 incognito.admin 权限的在线玩家会在保存待处理更改以及在登录时生效时收到通知。他们不需要 incognito.reveal 权限。这些通知中的真实姓名仅向授权接收者显示。
更改生效后的示例消息:
Incognito >> Player Notch enabled incognito, new nickname: incognito123
Incognito >> Player incognito123 disabled incognito, new nickname: Notch
在重新连接之前,通知会描述待处理的更改。以隐身模式重新加入时,会发送一条新别名通知。取消待处理更改会有单独的通知;请求已保存的状态则不会发送额外通知。
模板位于 messages 部分下的 notify-enabled、notify-disabled、notify-alias-changed、notify-pending-enabled、notify-pending-disabled 和 notify-cancelled。将单个模板设置为 '' 即可禁用该通知。<player> 是真实名称,<name> 是别名。messages 中的所有模板均支持 MiniMessage。
保护设置
完整配置、默认值和注释请参阅 config.yml。
| 键 |
用途 |
names.enabled |
启用名称掩码,并在支持的文本中将真实 UUID 替换为会话 UUID。支持带连字符和紧凑格式的 UUID。 |
names.mask-player-messages |
默认为 false:保留玩家撰写的聊天内容。设置为 true 以屏蔽玩家消息中的隐身名称和 UUID。没有隐身会话的名称保持不变。结构化发送者名称始终独立于此选项进行屏蔽。 |
names.mask-system-messages |
默认为 true:屏蔽服务器聊天消息(包括加入、离开和死亡公告)以及死亡屏幕上的隐身名称和 UUID。设置为 false 以保留这些消息,但这可能会暴露真实身份。此选项不控制玩家聊天或其他 UI 文本(如标题和操作栏)。 |
names.format |
别名模式,默认为 Anon_{random}。必须包含 {random};其他字符必须是 ASCII 字母、数字或 _。别名长度限制为 16 个字符。 |
names.tabcomplete |
在命令建议和聊天名称补全中使用别名。禁用后,建议中仍显示真实名称。 |
names.hide_realname |
在服务器的在线玩家名称映射中用别名替换真实名称。离线查询仍保留真实名称;其他插件中的自定义查询机制可能绕过此映射。 |
skin.enabled |
对其他查看者屏蔽皮肤。 |
skin.value, skin.signature |
可选的共享皮肤,作为签名 Minecraft 配置文件纹理属性。需同时设置这两个值;它们不是用户名或图片 URL。 |
heads |
屏蔽数据包中的玩家头颅。 |
books |
当名称掩码激活时,使用别名作为书籍的作者署名。 |
coordinates.enabled |
沿 X/Z 轴偏移可见世界。Y 轴保持不变。 |
coordinates.tabcomplete |
转换命令建议中的坐标。 |
coordinates.patterns |
用于文本中坐标的正则表达式,使用命名捕获组 x 和 z。 |
placeholders.enabled |
过滤 PlaceholderAPI 扩展的结果。 |
debug |
记录详细的包变换信息以便故障排除。 |
掩码仅适用于发送给客户端的支持数据。它不会从数据库、日志或其他插件保留的数据中移除真实名称。Incognito 并非隐匿状态:玩家在世界中仍然可见。
两个消息选项都需要 names.enabled。启用 names.mask-system-messages 后,加入、离开和死亡消息字段会在 LOWEST 和 HIGHEST 事件优先级下进行屏蔽。死亡屏幕覆盖内容和独立的死亡屏幕数据包也受此保护。无论消息选项如何,AsyncChatEvent 渲染器都会收到一个被屏蔽的发送者显示名称。这些事件转换不会移动坐标;出站数据包过滤器会应用接收者的坐标偏移量。
服务器的 Player 对象保留其真实 UUID 和账户名称,因此权限、物品栏和其他玩家数据保持其原始身份。已安装的插件仍可访问该对象,并可以重建真实名称或 UUID。忽略所提供显示名称的自定义插件通道和渲染器需要集成;事件掩码并不能使插件彼此隔离。当 names.mask-player-messages: false 时,非结构化的玩家聊天内容将被保留,包括由自定义渲染器生成的内容。插件作为非结构化系统聊天发送的消息遵循 names.mask-system-messages。普通的物品元数据和以前写好的书籍不受此文本过滤覆盖。
占位符
安装相应的集成后,可使用以下占位符:
| PlaceholderAPI |
MiniPlaceholders |
结果 |
%incognito_enabled% |
<incognito_enabled> |
当前会话的 true 或 false。 |
%incognito_name% |
<incognito_name> |
当前别名或普通玩家名称。 |
%incognito_realname% |
<incognito_realname> |
在线隐身玩家的真实名称,对拥有 incognito.reveal 权限的接收者可见;否则为空。 |
%incognito_x% |
<incognito_x> |
可见方块 X 坐标。 |
%incognito_y% |
<incognito_y> |
方块 Y 坐标。 |
%incognito_z% |
<incognito_z> |
可见方块 Z 坐标。 |
%incognito_world% |
<incognito_world> |
世界名称。 |
MiniPlaceholders 标签需要一个玩家受众。Incognito 自身的占位符独立于 placeholders.enabled 注册;该选项控制对其他 PlaceholderAPI 扩展结果的包装。
存储
默认后端是位于 plugins/Incognito/data.db 的 SQLite。记录包含 UUID、真实名称、请求的隐身状态、消息偏好以及禁用通知所需的最后一个别名。存储的别名用于通知;登录时会生成一个新的别名。坐标偏移量单独存储在 coordinate-sessions.yml 中。
对于 MySQL,请创建数据库并进行如下配置:
storage:
type: mysql
host: localhost
port: 3306
database: incognito
username: incognito
password: ''
table-prefix: incognito_
pool-size: 4
对于 PostgreSQL,请使用 type: postgresql(或 postgres)以及相应的端口,通常为 5432。数据库账户必须具有创建和修改表的权限。切换后端不会在数据库之间自动迁移记录。写入操作是异步的,未完成的更改会在插件正常关闭时刷新。
Incognito
Incognito is a Minecraft plugin for Paper and Folia that lets players hide their identity behind a random alias. It masks names and skins in data sent to clients and shifts visible world coordinates. Administrators can manage players' incognito settings and receive notifications about identity changes.
Features
- A random alias on each incognito login, used in the profile, player list and nametag.
- Name masking in chat, scoreboards, boss bars, holograms and supported text sent by other plugins.
- Hidden skins or a shared replacement skin for other viewers. Players still see their own skin.
- Player head masking in inventories, equipment, dropped items and placed blocks. Original item profiles remain stored on the server.
- Books signed with the player's alias while incognito is active.
- X/Z offsets in the world view, F3, minimaps and supported text. Coordinates entered in supported commands are translated back to server coordinates.
- Player preferences or server rules for showing join and quit messages.
- Administrative notifications containing real names and aliases.
- Optional PlaceholderAPI and MiniPlaceholders integrations, with SQLite, MySQL or PostgreSQL storage.
Requirements and installation
The project builds against Paper API 1.21.8 by default and targets Java 21. Folia support is declared in the plugin metadata. Packet filtering uses internal server classes, so compatibility with other Minecraft versions should be verified before deployment.
- Build the project or obtain a packaged
Incognito-v<version>.jar.
- Place the JAR in the server's
plugins directory and restart the server.
- Edit
plugins/Incognito/config.yml and grant players incognito.use.
- Restart the server after configuration changes. Missing configuration keys are added at startup.
PlaceholderAPI and MiniPlaceholders are optional. Database libraries are loaded through the server's library mechanism. The plugin also uses bStats metrics, controlled by the server's bStats settings.
Using incognito
/incognito saves the requested state. Enabling and disabling protection takes effect after the player disconnects and rejoins, including when coordinate masking is disabled. The player receives a pending-change message; the plugin does not automatically disconnect them to apply it.
/incognito status shows the active alias, disabled state or pending change. Toggling again before disconnecting cancels a pending change. Aliases are generated during login.
Commands and permissions
Command alias: /incog.
| Command |
Action |
/incognito |
Toggles the requested incognito state. |
/incognito on / /incognito off |
Requests enabling or disabling incognito. |
/incognito status |
Shows the current protection state. |
/incognito messages |
Toggles visibility of the player's own join and quit messages while incognito is active. |
/incognito messages on / /incognito messages off |
Sets those messages to shown or hidden. |
/incognito messages status |
Shows the effective setting and whether changes are locked. |
/incognito player <player> [on|off] |
Changes an online player's state; toggles it when on/off is omitted. |
| Permission |
Default |
Purpose |
incognito.use |
OP |
Access to the command and personal incognito settings. |
incognito.admin |
OP |
Manage other players and receive incognito state and alias notifications. The administrative command also requires incognito.use. |
incognito.reveal |
OP |
View real names through the incognito_realname placeholder. Ordinary name masking remains active. |
Personal settings require a player sender. The console can use the player subcommand. With names.hide_realname: true, target incognito players by their aliases.
Join and quit messages
join-quit:
mode: player
default-show: true
allow-toggle: true
| Setting |
Behavior |
mode: player |
Uses each player's saved preference, or default-show until they choose one. |
mode: show |
Forces messages to be shown and blocks player changes. |
mode: hide |
Forces messages to be hidden and blocks player changes. |
default-show |
Initial setting in player mode: true shows messages, false hides them. |
allow-toggle: false |
Locks changes in player mode while preserving saved preferences and the default for players without a preference. |
A preference controls both join and quit announcements about that player, as seen by everyone in chat. It is saved in the database and can be set before enabling incognito. It applies to subsequent join and quit events while protection is active. Messages for players without incognito remain under the server's control.
When showing messages, the plugin preserves the event message and masks the player's name if names.enabled and names.mask-system-messages are enabled. In show mode, if the message was previously cleared, it supplies messages.join-message or messages.quit-message. In player mode, suppression by another plugin is preserved. These rules control standard join and quit events; separate broadcasts sent directly by other plugins are outside their scope. Another listener modifying the event later can change the result.
Administrative notifications
Online players with incognito.admin receive notifications when a pending change is saved and when it takes effect at login. They do not need incognito.reveal. Real names in these notifications are shown only to authorized recipients.
Example messages after a change takes effect:
Incognito >> Player Notch enabled incognito, new nickname: incognito123
Incognito >> Player incognito123 disabled incognito, new nickname: Notch
Before reconnection, the notification describes the pending change. Rejoining with incognito still active sends a new-alias notification. Canceling a pending change has a separate notification; requesting an already saved state does not send another notification.
Templates are in the messages section under notify-enabled, notify-disabled, notify-alias-changed, notify-pending-enabled, notify-pending-disabled and notify-cancelled. Set an individual template to '' to disable that notification. <player> is the real name and <name> is the alias. All templates in messages support MiniMessage.
Protection settings
See config.yml for the full configuration, defaults and comments.
| Key |
Purpose |
names.enabled |
Enables name masking and replacement of real UUIDs in supported text with session UUIDs. Dashed and compact UUIDs are supported. |
names.mask-player-messages |
Default false: preserves player-written chat content. Set true to mask incognito names and UUIDs inside player messages. Names without an incognito session are unchanged. Structured sender names remain masked independently of this option. |
names.mask-system-messages |
Default true: masks incognito names and UUIDs in server chat messages, including join, quit and death announcements, and on the death screen. Set false to preserve those messages, which may expose real identities. Does not control player chat or other UI text such as titles and action bars. |
names.format |
Alias pattern, default Anon_{random}. Requires {random}; other characters must be ASCII letters, digits or _. Aliases are limited to 16 characters. |
names.tabcomplete |
Uses aliases in command suggestions and chat name completion. Disabling it leaves real names in suggestions. |
names.hide_realname |
Replaces the real name with the alias in the server's online-player name map. Offline lookups retain the real name; custom lookup mechanisms in other plugins may bypass this map. |
skin.enabled |
Masks skins for other viewers. |
skin.value, skin.signature |
Optional shared skin as signed Minecraft profile texture properties. Set both together; these are not a username or image URL. |
heads |
Masks player heads in packets. |
books |
Uses the alias as the author when signing a book while name masking is active. |
coordinates.enabled |
Shifts the visible world along X/Z. Y is unchanged. |
coordinates.tabcomplete |
Translates coordinates in command suggestions. |
coordinates.patterns |
Regular expressions for coordinates in text, using named x and z capture groups. |
placeholders.enabled |
Filters results from PlaceholderAPI expansions. |
debug |
Logs detailed packet transformations for troubleshooting. |
Masking applies to supported data sent to clients. It does not remove real names from databases, logs or data retained by other plugins. Incognito is not vanish: the player remains visible in the world.
Both message options require names.enabled. With names.mask-system-messages enabled, join, quit and death message fields are masked at LOWEST and HIGHEST event priorities. Death-screen overrides and the separate death-screen packet are covered as well. The AsyncChatEvent renderer receives a masked sender display name regardless of the message options. These event transformations do not shift coordinates; the outgoing packet filter applies the recipient's coordinate offset.
The server's Player object retains its real UUID and account name so permissions, inventories and other player data keep their original identity. Installed plugins still have access to that object and can reconstruct real names or UUIDs. Custom plugin channels and renderers that ignore the supplied display name require integration; event masking does not isolate plugins from each other. With names.mask-player-messages: false, unstructured player chat content is preserved, including content generated by a custom renderer. Messages sent by plugins as unstructured system chat follow names.mask-system-messages. Ordinary item metadata and previously written books are not covered by this text filtering.
Placeholders
The following placeholders are available when the corresponding integration is installed:
| PlaceholderAPI |
MiniPlaceholders |
Result |
%incognito_enabled% |
<incognito_enabled> |
true or false for the active session. |
%incognito_name% |
<incognito_name> |
Active alias or ordinary player name. |
%incognito_realname% |
<incognito_realname> |
Real name of an online incognito player, revealed to recipients with incognito.reveal; otherwise empty. |
%incognito_x% |
<incognito_x> |
Visible block X coordinate. |
%incognito_y% |
<incognito_y> |
Block Y coordinate. |
%incognito_z% |
<incognito_z> |
Visible block Z coordinate. |
%incognito_world% |
<incognito_world> |
World name. |
MiniPlaceholders tags require a player audience. Incognito's own placeholders are registered independently of placeholders.enabled; that option controls wrapping results from other PlaceholderAPI expansions.
Storage
The default backend is SQLite at plugins/Incognito/data.db. Records contain the UUID, real name, requested incognito state, message preference and last alias needed for the disable notification. The stored alias is used for notifications; a new alias is generated at login. Coordinate offsets are stored separately in coordinate-sessions.yml.
For MySQL, create a database and configure:
storage:
type: mysql
host: localhost
port: 3306
database: incognito
username: incognito
password: ''
table-prefix: incognito_
pool-size: 4
For PostgreSQL, use type: postgresql (or postgres) and the appropriate port, usually 5432. The database account must be able to create and alter tables. Switching backends does not automatically transfer records between databases. Writes are asynchronous, and pending changes are flushed during a normal plugin shutdown.
评论 0
登录后参与评分
还没有评论,来抢沙发吧