环绕世界
无缝地将玩家传送至可配置边界的另一侧——无需模组,无需插件,仅靠数据包即可实现。
概述
Wrap Around World 为你的世界添加了一个完全可配置的假边界。当玩家沿任意轴向越过该边界时,会被瞬间传送至相反一侧——从而营造出类似经典街机游戏或地球球体般的环绕式、环形世界效果。
通过一条命令即可随时调整边界大小,且除了操作栏提示外,该效果对玩家完全不可见。
功能特性
-
? 环绕传送 —— 穿越 +X、-X、+Z 或 -Z 边界将把你传送至对面
-
? 完全可配置的边界 —— 使用一条命令即可实时更改边界大小,无需重新加载
-
? 持久化配置 — 边框大小在世界重载后保持不变
-
⚡ 轻量级 — 每个玩家每刻仅进行一次计分板检查,绝无多余操作
-
? 无需模组支持 — 纯原版数据包,兼容任意服务器
安装方法
- 下载
.zip 文件
- 将其放入你世界的
datapacks/ 文件夹中:
saves/<your-world>/datapacks/wbtp_datapack.zip
- 在游戏中运行
/reload,或重新加载世界
- 你应在聊天栏中看到确认消息
注意: 数据包必须保持为 .zip 格式——请勿解压。
使用方法
查看当前边界大小
/function wbtp:set_border
输出当前的边界距离以及修改该边界的命令。
设置自定义边界大小
/scoreboard players set #border wbtp.config <size>
示例:
| /scoreboard players set #border wbtp.config 3500 | 默认 — 7000×7000 方块游戏区域 |
| /scoreboard players set #border wbtp.config 1000 | 紧凑 — 2000×2000 方块游戏区域 |
| /scoreboard players set #border wbtp.config 10000 | 大型 — 20000×20000 方块游戏区域 |
更改立即生效——无需重新加载。
工作原理
每个游戏刻(tick),系统会读取每位玩家的 X 和 Z 坐标并将其记录到记分板中,然后与配置的 #border 值进行比较。如果玩家在任一方向上达到或超过该阈值,他们将被传送至另一侧的 (border - 10) 位置,安全地落在边界内 10 个方块处,以防止触发循环。
传送功能使用 Minecraft 1.20.2 引入的 函数宏 系统($tp),这是基于坐标传送的正确现代方法,因为 1.20.5 中已移除了直接 NBT 位置写入的方式。
兼容性
| 版本 |
状态 |
| 1.21.1 |
✅ 完全支持 |
| 1.20.5 – 1.20.6 |
✅ 应该可以运行(未测试) |
| 1.20.2 – 1.20.4 |
⚠️ 需要宏支持 —— 未测试 |
| 低于 1.20.2 |
❌ 不支持 |
已知限制
- 坐标以整数形式存储——传送时不会保留子方块精度。玩家将落在完整的方块坐标位置上。
- 边界适用于所有维度(主世界、下界、末地)。如果你只想在主世界中应用此边界,则需要进行少量修改。
- Minecraft 的世界边界与本数据包的假边界是相互独立的——本数据包不会替代或与
/worldborder 命令交互。
许可证
此数据包可免费用于任何服务器、任何整合包,或作为您自己项目的基础。署名虽被感谢但非必需。
Wrap Around World
Seamlessly wrap players to the opposite side of a configurable boundary — no mods, no plugins, just a datapack.
Overview
Wrap Around World adds a fully configurable fake border to your world. When a player crosses the boundary on any axis, they are instantly teleported to the opposite side — creating a wrap-around, toroidal world effect similar to classic arcade games, or a globe earth.
The boundary size is adjustable at any time with a single command, and the effect is completely invisible to the player aside from the actionbar notification.
Features
- ? Wrap-around teleportation — crossing
+X, -X, +Z, or -Z sends you to the opposite side
- ? Fully configurable boundary — change the border size live with one command, no reload required
- ? Persistent config — border size survives world reloads
- ⚡ Lightweight — a single scoreboard check per player per tick, nothing more
- ? No mods required — pure vanilla datapack, compatible with any server
Installation
- Download the
.zip file
- Place it in your world's
datapacks/ folder:
saves/<your-world>/datapacks/wbtp_datapack.zip
- Run
/reload in-game, or load into the world
- You should see the confirmation message in chat
Note: The datapack must remain as a .zip — do not extract it.
Usage
Check the current border size
/function wbtp:set_border
Prints the current boundary distance and the command to change it.
Set a custom border size
/scoreboard players set #border wbtp.config <size>
Examples:
| Command |
Effect |
/scoreboard players set #border wbtp.config 3500 |
Default — 7000×7000 block play area |
/scoreboard players set #border wbtp.config 1000 |
Compact — 2000×2000 block play area |
/scoreboard players set #border wbtp.config 10000 |
Large — 20000×20000 block play area |
The change takes effect immediately — no reload needed.
How It Works
Every tick, each player's X and Z coordinates are read into scoreboards and compared against the configured #border value. If a player meets or exceeds the threshold in any direction, they are teleported to (border - 10) on the opposite side, landing safely 10 blocks inside the boundary to prevent a re-trigger loop.
Teleportation uses Minecraft's function macro system ($tp) introduced in 1.20.2, which is the correct modern approach for coordinate-based teleportation since direct NBT position writes were removed in 1.20.5.
Compatibility
| Version |
Status |
| 1.21.1 |
✅ Fully supported |
| 1.20.5 – 1.20.6 |
✅ Should work (untested) |
| 1.20.2 – 1.20.4 |
⚠️ Requires macro support — untested |
| Below 1.20.2 |
❌ Not supported |
Known Limitations
- Coordinates are stored as integers — sub-block precision is not preserved on teleport. Players land at whole-block coordinates.
- The boundary applies to all dimensions (Overworld, Nether, End). If you only want it in the Overworld, this would require a small modification.
- The Minecraft world border and this datapack's fake border are independent — this does not replace or interact with
/worldborder.
License
This datapack is free to use on any server, in any modpack, or as a base for your own projects. Credit is appreciated but not required.
评论 0
登录后参与评分
还没有评论,来抢沙发吧