VanillaCommandAdvance

插件

· 作者 Fell__o_o

在 Paper 和 Folia 上对原版 /gamemode 和 /tp 的增强替代方案:灵活的权限、自定义别名、可配置的消息以及公共 API。

0 本站下载 0 关注 更新于 6 天前

最新 1.0.0 · 26.3 · Bukkit / Folia

一键开服(送7天)

VanillaCommandAdvance

适用于 Paper 和 Folia 的插件,将原版的 /gamemode 和 /tp 命令替换为自定义版本:每种模式每种传送类型拥有独立的权限、自定义别名以及可自定义的服务端消息。

支持版本:1.21.x, 26.1, 26.1.x, 26.x

中文说明

/gamemode

用法与原版一致:/gamemode <模式> [玩家]。模式名称可以任意输入,例如 creative、c 或 1。默认提供别名 /gm,因此使用 /gm c 即可。补全提示中仅显示该玩家拥有权限的模式。

权限 功能说明
vanillacommandadvance.gamemode.survival 生存模式
vanillacommandadvance.gamemode.creative 创造模式
vanillacommandadvance.gamemode.adventure 冒险模式
vanillacommandadvance.gamemode.spectator 旁观者模式
vanillacommandadvance.gamemode.others 修改其他玩家的模式

/tp

支持所有原版传送方式:传送到玩家、通过坐标传送(包括 ~ 和 ^)、一名玩家传送到另一名玩家,以及使用 @a 和 @e 选择器。在原版基础上,坐标后可指定目标世界:/tp 0 100 0 world_nether。

默认情况下,只有执行命令的玩家能看到传送消息。此行为由 silent-target 参数控制。

权限 功能说明
vanillacommandadvance.tp.self 传送自己
vanillacommandadvance.tp.others 传送其他玩家和实体
vanillacommandadvance.tp.coords 通过坐标传送
vanillacommandadvance.tp.worlds 在不同世界间传送
vanillacommandadvance.tp.silent 被传送的玩家不会收到任何消息

配置文件

可以禁用任一命令,此时服务器将恢复使用原版命令。可以为每个命令设置独立的别名。

所有消息均位于 messages.yml 文件中,并使用 MiniMessage 格式编写。可以使用占位符 <player>、<target>、<sender>、<gamemode>、<x>、<y>、<z> 和 <world>。

执行 /vca reload 可在不重启服务器的情况下重新加载消息和配置。仅启用/禁用命令及设置别名需要重启服务器才能生效。

Folia 和 API

在 Folia 上,模式切换和传送操作均在玩家所属的区域线程中执行,符合预期规范。传送通过 teleportAsync 实现,从而在不阻塞服务器的情况下加载区块。

插件提供了两个可取消的事件。在 CommandGameModeEvent 中可以替换目标模式,在 CommandTeleportEvent 中可以替换传送目的地。

English

/gamemode

Works the usual way: /gamemode <mode> [players]. The mode can be typed however you like: creative, c or 1. There's a /gm alias by default, so /gm c is enough. Tab completion only shows the modes the player has permission for.

Permission What it allows
vanillacommandadvance.gamemode.survival Survival mode
vanillacommandadvance.gamemode.creative Creative mode
vanillacommandadvance.gamemode.adventure Adventure mode
vanillacommandadvance.gamemode.spectator Spectator mode
vanillacommandadvance.gamemode.others Changing other players' mode

/tp

Every vanilla form works: to a player, by coordinates (including ~ and ^), one player to another, and the @a and @e selectors. On top of vanilla, you can put a world after the coordinates: /tp 0 100 0 world_nether.

By default only the person who ran the command sees the teleport message. That's what silent-target controls.

Permission What it allows
vanillacommandadvance.tp.self Teleporting yourself
vanillacommandadvance.tp.others Teleporting other players and entities
vanillacommandadvance.tp.coords Teleporting by coordinates
vanillacommandadvance.tp.worlds Teleporting between worlds
vanillacommandadvance.tp.silent The teleported player never gets a message

Config

Any of the commands can be turned off, and then the vanilla one is back on the server. Each command gets its own aliases.

Every message lives in messages.yml and is written in MiniMessage. You can use the placeholders <player>, <target>, <sender>, <gamemode>, <x>, <y>, <z> and <world>.

/vca reload reloads messages and settings without a restart. Only turning commands on or off and aliases need a restart to apply.

Folia and API

On Folia, mode changes and teleports run on the player's region thread, the way they should. Teleports go through teleportAsync, so the chunk loads without stalling the server.

There are two cancellable events. In CommandGameModeEvent you can swap the mode, and in CommandTeleportEvent the destination.

权限列表

  • vanillacommandadvance.tp.self — 传送自己
  • vanillacommandadvance.tp.others — 传送其他玩家和实体
  • vanillacommandadvance.tp.coords — 通过坐标传送
  • vanillacommandadvance.tp.worlds — 在不同世界间传送
  • vanillacommandadvance.tp.silent — 被传送的玩家不会收到任何消息

⚙️ 配置选项

  • 可禁用任一命令,禁用后恢复使用原版命令
  • 支持为每个命令设置独立别名
  • 所有文本位于 messages.yml 中(支持 MiniMessage 格式,可使用占位符 <player>、<target>、<sender>、<gamemode>、<x>、<y>、<z>、<world>)
  • 执行 /vca reload 可在不重启服务器的情况下重新加载文本和配置;启用/禁用命令及设置别名需重启服务器后生效

🚀 Folia 支持与 API

  • 完全支持 Folia:模式切换和传送操作在玩家所属的区域线程中执行
  • 通过 teleportAsync 进行传送:在不阻塞服务器的情况下加载区块
  • 提供两个可取消的事件:CommandGameModeEvent(可替换目标模式)和 CommandTeleportEvent(可替换传送目的地)

🇬🇧 English

🎮 /gamemode

/gamemode <mode> [players]. Any input format works: creative, c, 1. The default alias is /gm, so /gm c works too. Suggestions only show the modes the player has permission for.

权限

  • vanillacommandadvance.gamemode.survival
  • vanillacommandadvance.gamemode.creative
  • vanillacommandadvance.gamemode.adventure
  • vanillacommandadvance.gamemode.spectator
  • vanillacommandadvance.gamemode.others — 更改其他玩家的模式

🧭 /tp

支持所有原版形式:传送到玩家、通过坐标(包括 ~ 和 ^)、玩家到玩家、@a 和 @e 选择器。坐标后可跟随世界名称:/tp 0 100 0 world_nether。默认情况下,只有发送者能看到消息(静默目标)。

权限

  • vanillacommandadvance.tp.self — 传送自己
  • vanillacommandadvance.tp.others — 传送其他玩家和实体
  • vanillacommandadvance.tp.coords — 通过坐标传送
  • vanillacommandadvance.tp.worlds — 在世界之间传送
  • vanillacommandadvance.tp.silent — 被传送的玩家不会收到任何消息

⚙️ 配置

  • 可以禁用任何命令(回退到原版行为)
  • 为每个命令设置自定义别名
  • 所有文本位于 messages.yml 中(使用 MiniMessage 格式,占位符 <player>、<target>、<sender>、<gamemode>、<x>、<y>、<z>、<world>)
  • /vca reload 可在不重启的情况下重新加载文本和设置。启用命令和别名的操作需要在重启后生效

🚀 Folia / API

  • 完全支持 Folia:模式更改和传送在玩家所在的区域线程上运行
  • 传送使用 teleportAsync:区块加载时不会阻塞服务器
  • 可取消的 CommandGameModeEvent(可替换模式)和 CommandTeleportEvent(可替换目的地)

你是这个资源的作者?登录后可认领此资源。

评论 0

0.0
暂无评分
5 星
0
4 星
0
3 星
0
2 星
0
1 星
0
我的评分

登录后参与评分

还没有评论,来抢沙发吧

评论配图

相似资源