tpa
中文文档 | 点击此处查看中文文档
一个 Minecraft 服务端模组,添加了多种与传送相关的命令,包括 /home、/tpa、/back、/rtp 等。
当前版本:1.0.7
项目地址:
更新日志
支持的平台
| 平台 |
支持的版本 |
| Fabric |
1.21.11, 26.1, 26.1.1, 26.1.2, 26.2, 26.3 |
仅支持 Fabric。
依赖项
- Fabric Loader(使用每个特定版本 JAR 文件中声明的最低版本)
- Minecraft 1.21.11, 26.1, 26.1.1, 26.1.2, 26.2 或 26.3
- Minecraft 1.21.11 需要 Java 21,Minecraft 26.x 系列需要 Java 25
可用命令
/tpals - 显示所有可用命令
/spawn [<disableSafetyCheck>] - 传送至主世界出生点。使用 true 跳过安全检查
/back [<disableSafetyCheck>] - 传送至你上次死亡的位置。使用 true 跳过安全检查
/sethome <name> - 设置一个家坐标
/home [<name>] - 传送至一个家。省略名称则前往默认的家
/delhome <name> - 删除一个家
/renamehome <name> <newName> - 重命名一个家
/defaulthome <name> - 设置默认的家
/homes - 查看所有家,并在 GUI 中从原版物品中选择图标
/warp <name> - 传送至一个公共传送点
/warps - 查看所有公共传送点;管理员可以在 GUI 中自定义传送点图标
/setwarp <name> - 设置一个公共传送点(需要管理员权限)
/delwarp <name> - 删除一个公共传送点(需要管理员权限)
/renamewarp <name> <newName> - 重命名一个公共传送点(需要管理员权限)
/tpa <player> - 向一名玩家发送传送请求
/tpahere <player> - 请求一名玩家传送到你身边
/tpaaccept <player> - 接受传送请求
/tpadeny <player> - 拒绝传送请求
/rtp [<dimension>] - 随机传送。可以指定维度
/tpastorage json-to-sqlite - 将旧版 JSON 导入 SQLite 并自动重新加载(需要管理员权限)
/tpareload - 重新加载配置文件、SQLite 数据和内置语言文件(需要管理员权限)
配置
配置文件位于 config/tpa/config.yml。每个选项都包含注释以便轻松定制:
# TPA 插件配置文件
# 编辑后请运行 /tpareload,或重启服务器
# 语言设置,选项:zh_cn, en_us
language: en_us
# /back 命令配置
back:
# 是否启用此命令
enabled: true
# 传送后是否删除死亡位置记录
deleteAfterTeleport: false
# /home 命令配置
home:
enabled: true
# 每个玩家的最大家数量
playerMaximum: 20
# 是否自动删除无效位置(当世界不存在时)
deleteInvalid: false
# 传送延迟时间(秒),0 表示立即传送
delay: 0
# /tpa 命令配置
tpa:
enabled: true
delay: 3
# 移动是否取消待处理的传送
cancelOnMove: true
# 过期前提醒的时间(秒);请求在 120 秒后过期
requestExpireReminder: 30
# /warp 命令配置
warp:
enabled: true
deleteInvalid: false
# /spawn 命令配置
spawn:
enabled: true
# 出生点的世界 ID,默认为主世界
world_id: minecraft:overworld
# /rtp 命令配置
rtp:
enabled: true
# 最小随机传送范围(方块)
minRange: 1000
# 最大随机传送范围(方块)
maxRange: 2000
# 启用成功和失败冷却时间
cooldownEnabled: true
# 成功后的冷却时间(秒);0 表示禁用
cooldownSeconds: 30
# 服务器范围内的并发请求数(1-10);达到上限时拒绝请求
maxConcurrentLoads: 10
# 最终失败或取消后的冷却时间(秒);0 表示禁用
failureCooldownSeconds: 30
# 每次请求尝试的最大随机位置数(1-100)
maxAttempts: 10
# 总搜索超时时间(秒)(1-120)
timeoutSeconds: 15
# 单个区块加载超时时间(秒)(1-30)
loadTimeoutSeconds: 5
# 传送后的普通伤害保护时间(刻)(0-1200);0 表示禁用
invulnerabilityTicks: 60
# 被阻止的生物群系 ID 或以 # 开头的引用标签
biomeBlacklist: ['#minecraft:is_ocean', '#minecraft:is_river']
# 危险方块 ID 或标签;流体、树叶和基岩始终被拒绝
floorBlacklist: [minecraft:lava, minecraft:water, minecraft:magma_block, minecraft:powder_snow, '#minecraft:leaves', minecraft:cactus, minecraft:fire, minecraft:soul_fire, minecraft:sweet_berry_bush, minecraft:cobweb, minecraft:campfire, minecraft:soul_campfire]
# 按维度的搜索模式、中心和黑名单设置
dimensions: {}
随机传送
在当前维度使用 /rtp,或指定 /rtp minecraft:the_nether、/rtp minecraft:the_end 或已加载的自定义维度 ID。操作栏会显示搜索进度,直到找到安全目的地或搜索结束。没有固定的倒计时;超时或尝试次数耗尽时会报告失败。
坐标是在目标维度出生点周围,介于 minRange 和 maxRange 之间选择的。开放维度使用地表地面;封闭维度搜索内部地面。流体、树叶和危险方块会被排除。雪取决于其碰撞形状。当不存在安全目的地时,搜索会失败。
冷却时间在成功或最终失败后开始。cooldownEnabled=false 禁用两种冷却时间;cooldownSeconds=0 禁用成功冷却时间,failureCooldownSeconds=0 禁用失败冷却时间。重复使用该命令会显示剩余秒数。容量拒绝不适用冷却时间。传送后的保护不会阻挡绕过无敌的伤害,例如虚空或 /kill。
在 rtp.dimensions 下使用完整的维度 ID 设置每个维度的规则。mode 接受 auto、surface 或 interior。未指定的范围和黑名单将继承全局值;中心默认为该维度的出生点。示例:
dimensions:
'custom:moon':
mode: surface
centerX: 0
centerZ: 0
minRange: 100
maxRange: 800
biomeBlacklist: []
编辑配置后运行 /tpareload;待处理的搜索将被取消。缺失的设置会通过内置注释进行填充。更高的并发会增加服务器负载,而新区块的生成时间取决于硬件和地形。
自定义家园图标
在 /homes GUI 中:
- 左键点击家园以传送
- 点击底部的指南针图标,然后左键点击一个家园以将其设为默认,无需传送或更改其名称/图标颜色。再次点击指南针可取消操作。如果客户端支持,中键点击仍然可用;在原版生存模式下请使用指南针。
- 右键点击家园可查看其名称和坐标,然后点击“确认”以删除。取消或关闭则保留它。
Shift + 左键点击 家园以打开原版的物品图标选择器
Shift + 右键点击 家园以快速恢复默认的床图标
设置默认家园后,不带名称运行 /home 即可传送到那里。
默认选择不会改变名称颜色或图标。没有自定义图标的家园保留为青色床。现有的 /defaulthome <name> 命令仍然可用。
选择器每页显示 45 个原版物品,并提供上一页、下一页、返回和重置控件。仅列出 minecraft 命名空间中的物品;来自其他模组的物品被排除在外。仅存储物品注册表 ID。图标数据存储在 SQLite 中,现有家园保留默认的床图标。
自定义传送门图标与操作员权限
所有玩家都可以打开 /warps 并左键点击传送门进行传送。以下操作需要管理员权限:
- 右键点击传送门以删除它
Shift + 左键点击 传送门以打开原版的物品图标选择器
Shift + 右键点击 传送门以快速恢复默认的末影之眼图标
/setwarp、/delwarp、/renamewarp、/tpastorage 和 /tpareload 需要操作员权限。/tpals 仅向操作员显示这些管理命令。
/tpareload 重新读取 config.yml 和 storage.db,同步内置的英文和中文语言文件,并清除语言缓存。待处理的延迟传送和 TPA 请求将被取消,以便之后无法运行使用旧设置创建的回调。当前的 /back 死亡位置将被保留。
SQLite 存储与旧版数据导入
玩家、家园和传送门的数据存储在 SQLite 中。较旧的数据库会在首次启动时自动迁移,无需执行命令。首先会创建 storage.db.pre-v2-*.bak 备份;如果失败则会回滚并保留旧数据库。
如果 storage.db 不存在,现有的 storage.json 会自动导入并保留。现有的 SQLite 优先;显式的导入命令会替换其数据。若要降级,请停止服务器并恢复迁移前的备份;旧版模组无法读取新的数据结构。
运行时数据库位于 config/tpa/storage.db。
要显式用旧版 JSON 数据替换现有数据库,请将 storage.json 放置在 config/tpa/ 中,并以操作员身份运行此命令。正常的 SQLite 升级不需要此命令:
/tpastorage json-to-sqlite
成功导入后会自动执行与 /tpareload 相同的完整重载,因此导入的数据会立即加载,无需重启。源 JSON 文件不会被删除,现有的 storage.db 会被保留为带时间戳的备份。数据首先写入临时数据库并读回以进行验证;只有在验证成功后,才会以事务方式更新实时数据库。检查导入结果后归档或删除 JSON 文件。当 JSON 文件缺失或为空时,命令拒绝运行。
语言文件
语言文件位于 config/tpa/lang/。内置的 zh_cn.json 和 en_us.json 文件在每次启动时同步:
- 使用内置的默认翻译添加缺失的键
- 从内置文件中移除的键也会从外部文件中移除
- 保留现有值,因此自定义翻译不会被覆盖
- 其他自定义语言文件永远不会被修改
- 无效的内置语言文件在重建之前会备份为
.bak
这使得在新模组更新后自动提供新的翻译键。您还可以创建另一个语言文件并在配置中选择它。
数据存储
- 配置文件:
config/tpa/config.yml
- 语言文件:
config/tpa/lang/
- SQLite 玩家数据:
config/tpa/storage.db
- 旧版 JSON 导入源(可选):
config/tpa/storage.json
tpa
中文文档 | Click here for Chinese documentation
A Minecraft server-side mod that adds various teleportation-related commands, including /home, /tpa, /back, /rtp, and more.
Current version: 1.0.7
Project URL:
Changelog
Supported Platforms
| Platform |
Supported Version |
| Fabric |
1.21.11, 26.1, 26.1.1, 26.1.2, 26.2, 26.3 |
Fabric only.
Dependencies
- Fabric Loader (use the minimum version declared by each version-specific JAR)
- Minecraft 1.21.11, 26.1, 26.1.1, 26.1.2, 26.2, or 26.3
- Java 21 for Minecraft 1.21.11, or Java 25 for the Minecraft 26.x series
Available Commands
/tpals - Display all available commands
/spawn [<disableSafetyCheck>] - Teleport to the Overworld spawn point. Use true to skip safety checks
/back [<disableSafetyCheck>] - Teleport to your last death location. Use true to skip safety checks
/sethome <name> - Set a home location
/home [<name>] - Teleport to a home. Omit name to go to the default home
/delhome <name> - Delete a home
/renamehome <name> <newName> - Rename a home
/defaulthome <name> - Set the default home
/homes - View all homes and choose icons from all vanilla items in the GUI
/warp <name> - Teleport to a public warp
/warps - View all public warps; operators can customize warp icons in the GUI
/setwarp <name> - Set a public warp (requires operator permissions)
/delwarp <name> - Delete a public warp (requires operator permissions)
/renamewarp <name> <newName> - Rename a public warp (requires operator permissions)
/tpa <player> - Send a teleport request to a player
/tpahere <player> - Request a player to teleport to you
/tpaaccept <player> - Accept a teleport request
/tpadeny <player> - Deny a teleport request
/rtp [<dimension>] - Random teleportation. Can specify a dimension
/tpastorage json-to-sqlite - Import legacy JSON into SQLite and automatically reload it (requires administrator permissions)
/tpareload - Reload configuration, SQLite data, and bundled language files (requires administrator permissions)
Configuration
Configuration file is located at config/tpa/config.yml. Each option includes comments for easy customization:
# TPA Plugin Configuration File
# Run /tpareload after editing, or restart the server
# Language setting, options: zh_cn, en_us
language: en_us
# /back command configuration
back:
# Whether to enable this command
enabled: true
# Whether to delete death location record after teleport
deleteAfterTeleport: false
# /home command configuration
home:
enabled: true
# Maximum number of homes per player
playerMaximum: 20
# Whether to auto-delete invalid locations (when world doesn't exist)
deleteInvalid: false
# Teleport delay in seconds, 0 for instant teleport
delay: 0
# /tpa command configuration
tpa:
enabled: true
delay: 3
# Whether moving cancels pending teleport
cancelOnMove: true
# Seconds before expiration to remind; requests expire after 120 seconds
requestExpireReminder: 30
# /warp command configuration
warp:
enabled: true
deleteInvalid: false
# /spawn command configuration
spawn:
enabled: true
# World ID for spawn point, defaults to Overworld
world_id: minecraft:overworld
# /rtp command configuration
rtp:
enabled: true
# Minimum random teleport range (blocks)
minRange: 1000
# Maximum random teleport range (blocks)
maxRange: 2000
# Enable success and failure cooldowns
cooldownEnabled: true
# Cooldown after success, in seconds; 0 disables it
cooldownSeconds: 30
# Concurrent requests across the server (1-10); reject requests when full
maxConcurrentLoads: 10
# Cooldown after final failure or cancellation, in seconds; 0 disables it
failureCooldownSeconds: 30
# Maximum random positions tried per request (1-100)
maxAttempts: 10
# Total search timeout, in seconds (1-120)
timeoutSeconds: 15
# Individual chunk loading timeout, in seconds (1-30)
loadTimeoutSeconds: 5
# Ordinary damage protection after teleport, in ticks (0-1200); 0 disables it
invulnerabilityTicks: 60
# Blocked biome IDs or quoted tags beginning with #
biomeBlacklist: ['#minecraft:is_ocean', '#minecraft:is_river']
# Dangerous block IDs or tags; fluids, leaves and bedrock are always rejected
floorBlacklist: [minecraft:lava, minecraft:water, minecraft:magma_block, minecraft:powder_snow, '#minecraft:leaves', minecraft:cactus, minecraft:fire, minecraft:soul_fire, minecraft:sweet_berry_bush, minecraft:cobweb, minecraft:campfire, minecraft:soul_campfire]
# Per-dimension search mode, center, range and blacklist settings
dimensions: {}
Random Teleport
Use /rtp in the current dimension, or specify /rtp minecraft:the_nether, /rtp minecraft:the_end or a loaded custom dimension ID. The action bar displays search progress until a safe destination is found or the search ends. There is no fixed countdown; timeouts or exhausted attempts report failure.
Coordinates are selected around the target dimension's spawn between minRange and maxRange. Open dimensions use surface ground; ceiling dimensions search interior ground. Fluids, leaves and dangerous blocks are excluded. Snow depends on its collision shape. Searches fail when no safe destination exists.
Cooldown starts after success or final failure. cooldownEnabled=false disables both cooldowns; cooldownSeconds=0 disables success cooldown and failureCooldownSeconds=0 disables failure cooldown. Reusing the command shows remaining seconds. Capacity rejection does not apply cooldown. Post-teleport protection does not block damage that bypasses invulnerability, such as the void or /kill.
Set per-dimension rules under rtp.dimensions using full dimension IDs. mode accepts auto, surface or interior. Omitted ranges and blacklists inherit global values; the center defaults to that dimension's spawn. Example:
dimensions:
'custom:moon':
mode: surface
centerX: 0
centerZ: 0
minRange: 100
maxRange: 800
biomeBlacklist: []
Run /tpareload after editing configuration; pending searches are cancelled. Missing settings are populated with built-in comments. Higher concurrency increases server load, and new chunk generation time depends on hardware and terrain.
Custom Home Icons
In the /homes GUI:
- Left-click a home to teleport
- Click the bottom compass, then left-click a Home to set the default without teleporting or changing its name/icon colors. Click the compass again to cancel. Middle-click remains available when the client supports it; use the compass in vanilla survival.
- Right-click a home to review its name and coordinates, then left-click Confirm to delete. Cancel or close to keep it.
Shift + Left-click a home to open the vanilla item icon picker
Shift + Right-click a home to quickly restore the default bed icon
After setting a default home, run /home without a name to teleport there. The
default selection does not change the name color or icon. Homes without a
custom icon retain the cyan bed. The existing /defaulthome <name> command remains available.
The picker displays 45 vanilla items per page and provides previous, next, back,
and reset controls. Only items in the minecraft namespace are listed; items
from other mods are excluded. Only the item registry ID is stored. Icon data is
stored in SQLite, and existing homes keep the default bed icon.
Custom Warp Icons and Operator Permissions
All players can open /warps and left-click a warp to teleport. The following actions require administrator permissions:
- Right-click a warp to delete it
Shift + Left-click a warp to open the vanilla item icon picker
Shift + Right-click a warp to quickly restore the default Eye of Ender icon
/setwarp, /delwarp, /renamewarp, /tpastorage, and /tpareload require
operator permissions. /tpals displays these administrative commands only to
operators.
/tpareload rereads config.yml and storage.db, synchronizes the bundled
English and Chinese language files, and clears the language cache. Pending
delayed teleports and TPA requests are cancelled so callbacks created with old
settings cannot run afterward. Current /back death locations are preserved.
SQLite Storage and Legacy Data Import
Players, homes and warps are stored in SQLite. Older databases migrate automatically on first startup without a command. A storage.db.pre-v2-*.bak backup is created first; failure rolls back and preserves the old database.
If storage.db does not exist, an existing storage.json is imported automatically and retained. Existing SQLite takes precedence; the explicit import command replaces its data. To downgrade, stop the server and restore the pre-migration backup; older mods cannot read the new schema.
The runtime database is located at config/tpa/storage.db.
To explicitly replace an existing database with legacy JSON data, place
storage.json in config/tpa/ and run this command as an operator.
Normal SQLite upgrades do not require this command:
/tpastorage json-to-sqlite
A successful import automatically performs the same complete reload as
/tpareload, so imported data is loaded immediately without a restart. The source JSON file is
not deleted, and an existing storage.db is retained as a timestamped backup.
Data is first written to a temporary database and read back for verification;
the live database is updated transactionally only after verification succeeds. Archive or
remove the JSON after checking the import. The command refuses to run when the
JSON file is missing or empty.
Language Files
Language files are located in config/tpa/lang/. The bundled zh_cn.json and
en_us.json files are synchronized on every startup:
- Missing keys are added using the bundled default translations
- Keys removed from the bundled files are also removed from external files
- Existing values are preserved, so customized translations are not overwritten
- Other custom language files are never modified
- Invalid built-in language files are backed up as
.bak before being rebuilt
This makes new translation keys available automatically after a mod update.
You can also create another language file and select it in the configuration.
Data Storage
- Config file:
config/tpa/config.yml
- Language files:
config/tpa/lang/
- SQLite player data:
config/tpa/storage.db
- Legacy JSON import source (optional):
config/tpa/storage.json
评论 0
登录后参与评分
还没有评论,来抢沙发吧