FirstJoinTeleport
FirstJoinTeleport 是一个轻量级的 Paper 插件,当玩家首次加入特定世界时,会自动将他们传送至配置区域内的随机安全位置。非常适合希望玩家在随机地点而非出生点开始游戏的生存服务器。
功能特性
- 自动传送:玩家进入已配置的世界时将自动被传送
- 一次性传送:每个玩家在每个世界中仅会被传送一次(防止重复传送)
- 可配置区域:定义一个正方形半径范围,玩家可在该范围内被传送
- 倒计时计时器:传送前的可配置倒计时时间(默认 3 秒)
- 安全位置查找:自动寻找安全位置,支持无限重试
- 性能优化:使用异步区块加载以防止服务器卡顿
- 自定义消息:完全可自定义的消息内容(默认为西班牙语)
- 数据持久化:玩家的传送状态会自动保存
- 安全检查:避免将玩家传送至水中、岩浆中、虚空或洞穴中(最低 Y 坐标为 60)
要求
- 服务器软件:Paper 或 Spigot 1.20 或更高版本
- Java 版本:Java 21 或更高版本
安装步骤
- 从 Modrinth 下载最新 JAR 文件
- 将 JAR 文件放入服务器的
plugins 文件夹中
- 重启服务器或使用
/reload 命令
- 插件将在
plugins/randomteleport/ 目录下自动创建 config.yml 文件
配置说明
配置文件位于 plugins/randomteleport/config.yml。修改后,请重新加载插件或重启服务器。
配置选项
target-world(默认值:"world")
应发生传送的世界名称。玩家进入此世界时将被传送(如果此前未被传送过)。
target-world: "world"
radius(默认值:-1000 到 1000)
定义玩家可以被传送的正方形区域。坐标相对于世界的出生点位置。
radius:
min-x: -1000
max-x: 1000
min-z: -1000
max-z: 1000
示例:若出生点位于 (0, 64, 0),设置 min-x: -1000, max-x: 1000 将创建一个以出生点为中心、大小为 2000x2000 方块的区域。
countdown-seconds(默认值:3)
传送前倒计时的持续时间(秒)。在此期间玩家会看到倒计时消息。
countdown-seconds: 3
注意:将其设置为 0 将立即执行传送(不推荐,因为玩家将看不到任何警告)。
messages(全部可配置)
所有消息均支持使用 & 符号的 Minecraft 颜色代码。占位符 {seconds} 将被替换为倒计时数字。
messages:
countdown-start: "&aSerás teletransportado en {seconds} segundos..."
countdown-remaining: "&aTeletransporte en {seconds} segundos..."
teleporting: "&a¡Teletransportando!"
teleport-failed: "&cBuscando ubicación segura..."
already-teleported: "&7Ya has sido teletransportado a este mundo anteriormente."
可用消息:
countdown-start:倒计时开始时显示
countdown-remaining:倒计时期间每秒显示
teleporting:执行传送时显示
teleport-failed:如果未能找到位置则显示(在正常运行中不应发生)
already-teleported:如果玩家之前已被传送至此世界则显示
工作原理
- 当玩家进入已配置的
target-world 时,插件会检查他们此前是否已被传送
- 如果此前未被传送,则开始倒计时(默认 3 秒)
- 在倒计时期间,玩家会看到提示即将传送的消息
- 倒计时结束后,插件会在配置的半径范围内寻找随机安全位置
- 插件会无限重试,直到找到安全位置为止
- 找到后,通过异步区块加载执行玩家传送
- 将该玩家标记为此世界的“已传送”状态(存储在
players.yml 中)
安全特性
插件通过以下方式确保玩家被传送至安全位置:
- 坚实地面:检查玩家下方是否有坚实地面
- 空气空间:确保玩家上方至少有 2 个方块的空气空间
- 液体规避:避开水和岩浆方块
- 虚空保护:避开虚空位置
- 洞穴规避:仅传送至 Y=60 以上的位置(避开洞穴)
- 无限重试:无限重试直到找到安全位置
玩家数据
玩家的传送状态存储在 plugins/randomteleport/players.yml 文件中。该文件:
- 跟踪哪些玩家已被传送到哪些世界
- 每 5 分钟自动保存一次
- 玩家被传送时立即保存
- 服务器关闭时保存
若要重置玩家的传送状态:
- 编辑
plugins/randomteleport/players.yml
- 在
players: 下找到该玩家的 UUID 条目
- 从其
worlds: 列表中移除世界名称,或移除其整个条目
- 保存文件
若要重置所有玩家:
- 删除
players.yml 文件(它将自动重新创建)
性能
插件经过性能优化:
- 异步区块加载:使用异步区块加载以防止服务器卡顿
- 异步位置查找:安全位置查找在异步线程中运行
- 批量保存:玩家数据保存采用批处理模式(每 5 分钟一次)
- 最小影响:设计旨在对服务器性能的影响降至最低
故障排除
玩家未被传送
- 检查
target-world 是否与你的世界名称完全匹配(区分大小写)
- 验证世界是否存在且已加载
- 查看服务器日志中的错误信息
- 确保玩家此前未被传送过(检查
players.yml)
玩家被传送至不安全位置
- 这不应发生,但如果发生了,请检查世界是否具有有效的地形
- 确保半径区域内包含有效地形(并非全是虚空/水)
- 验证世界是否正确生成
倒计时未显示
- 检查
config.yml 中的消息配置是否正确
- 确认颜色代码使用的是
& 而不是 §
- 查看服务器控制台是否有报错信息
重置玩家传送状态
- 编辑
plugins/randomteleport/players.yml,删除该玩家的 UUID 条目
- 或者删除该文件以重置所有玩家的状态
- 重启服务器或等待下一次自动保存
插件未加载
- 确保你使用的是 Paper 或 Spigot 1.20 或更高版本
- 检查是否已安装 Java 21 或更高版本
- 查阅服务器日志以查找错误信息
- 验证 JAR 文件是否损坏
API 版本
命令与权限
本插件没有提供命令或权限——它根据世界变化自动运行。
集成
如果你希望与其他插件进行集成,本插件为管理器提供了公开获取方法:
getConfigManager() - 访问配置管理器
getPlayerDataManager() - 访问玩家数据管理器
getTeleportManager() - 访问传送逻辑管理器
getCountdownManager() - 访问倒计时管理器
其他插件可以通过调用 reload() 方法来重新加载配置。
支持
如果遇到任何问题或有疑问:
- 查看上面的故障排除部分
- 查阅服务器日志以查找错误信息
- 验证你的配置是否与示例一致
- 确保你使用的是兼容的服务器版本
许可证
有关使用和分发的信息,请查阅插件的许可证文件。
FirstJoinTeleport
FirstJoinTeleport is a lightweight Paper plugin that automatically teleports players to random safe locations within a configurable area when they first join a specific world. Perfect for survival servers where you want players to start in random locations rather than at spawn.
Features
- Automatic Teleportation: Players are automatically teleported when entering a configured world
- One-Time Teleportation: Each player is only teleported once per world (prevents repeated teleports)
- Configurable Area: Define a square radius where players can be teleported
- Countdown Timer: Configurable countdown before teleportation (default 3 seconds)
- Safe Location Finding: Automatically finds safe locations with infinite retries
- Performance Optimized: Uses async chunk loading to prevent server lag
- Customizable Messages: Fully customizable messages (defaults in Spanish)
- Data Persistence: Player teleportation status is saved automatically
- Safety Checks: Avoids water, lava, void, and cave locations (minimum Y=60)
Requirements
- Server Software: Paper or Spigot 1.20 or higher
- Java Version: Java 21 or higher
Installation
- Download the latest JAR file from Modrinth
- Place the JAR file in your server's
plugins folder
- Restart your server or use
/reload
- The plugin will automatically create a
config.yml file in plugins/randomteleport/
Configuration
The configuration file is located at plugins/randomteleport/config.yml. After making changes, reload the plugin or restart the server.
Configuration Options
target-world (default: "world")
The name of the world where teleportation should occur. Players entering this world will be teleported (if they haven't been teleported before).
target-world: "world"
radius (default: -1000 to 1000)
Defines the square area where players can be teleported. Coordinates are relative to the world's spawn location.
radius:
min-x: -1000
max-x: 1000
min-z: -1000
max-z: 1000
Example: With spawn at (0, 64, 0), min-x: -1000, max-x: 1000 creates a 2000x2000 block area centered at spawn.
countdown-seconds (default: 3)
Duration of the countdown before teleportation in seconds. Players see countdown messages during this time.
countdown-seconds: 3
Note: Setting this to 0 will teleport immediately (not recommended as players won't see any warning).
messages (all configurable)
All messages support Minecraft color codes using the & symbol. The placeholder {seconds} is replaced with the countdown number.
messages:
countdown-start: "&aSerás teletransportado en {seconds} segundos..."
countdown-remaining: "&aTeletransporte en {seconds} segundos..."
teleporting: "&a¡Teletransportando!"
teleport-failed: "&cBuscando ubicación segura..."
already-teleported: "&7Ya has sido teletransportado a este mundo anteriormente."
Available Messages:
countdown-start: Shown when countdown begins
countdown-remaining: Shown each second during countdown
teleporting: Shown when teleportation occurs
teleport-failed: Shown if location finding fails (shouldn't happen in normal operation)
already-teleported: Shown if player has already been teleported to this world
How It Works
- When a player enters the configured target world, the plugin checks if they've been teleported before
- If not teleported before, a countdown starts (default 3 seconds)
- During the countdown, players see messages indicating when they'll be teleported
- After the countdown, the plugin finds a random safe location within the configured radius
- The plugin retries indefinitely until a safe location is found
- Once found, the player is teleported using async chunk loading
- The player is marked as teleported for this world (stored in
players.yml)
Safety Features
The plugin ensures players are teleported to safe locations by:
- Solid Ground: Checking for solid ground below the player
- Air Space: Ensuring at least 2 blocks of air above the player
- Liquid Avoidance: Avoiding water and lava blocks
- Void Protection: Avoiding void locations
- Cave Avoidance: Only teleporting to locations above Y=60 (avoids caves)
- Infinite Retries: Retrying indefinitely until a safe location is found
Player Data
Player teleportation status is stored in plugins/randomteleport/players.yml. This file:
- Tracks which players have been teleported to which worlds
- Auto-saves every 5 minutes
- Saves immediately when a player is teleported
- Saves on server shutdown
To reset a player's teleportation status:
- Edit
plugins/randomteleport/players.yml
- Find the player's UUID entry under
players:
- Remove the world name from their
worlds: list, or remove their entire entry
- Save the file
To reset all players:
- Delete the
players.yml file (it will be recreated automatically)
Performance
The plugin is optimized for performance:
- Async Chunk Loading: Uses asynchronous chunk loading to prevent server lag
- Async Location Finding: Safe location finding runs asynchronously
- Batched Saves: Player data saves are batched (every 5 minutes)
- Minimal Impact: Designed to have minimal impact on server performance
Troubleshooting
Players Not Being Teleported
- Check that
target-world matches your world name exactly (case-sensitive)
- Verify the world exists and is loaded
- Check server logs for errors
- Ensure the player hasn't been teleported before (check
players.yml)
Players Teleported to Unsafe Locations
- This shouldn't happen, but if it does, check that the world has valid terrain
- Ensure the radius area contains valid terrain (not all void/water)
- Verify the world is properly generated
Countdown Not Showing
- Check that messages are properly configured in
config.yml
- Verify color codes are using
& not §
- Check server console for any errors
Reset Player Teleportation Status
- Edit
plugins/randomteleport/players.yml and remove the player's UUID entry
- Or delete the file to reset all players
- Restart the server or wait for the next auto-save
Plugin Not Loading
- Ensure you're using Paper or Spigot 1.20 or higher
- Check that Java 21 or higher is installed
- Review server logs for error messages
- Verify the JAR file is not corrupted
API Version
- Requires Paper API version 1.20 or higher
Commands & Permissions
This plugin has no commands or permissions - it works automatically based on world changes.
Integration
The plugin provides public getters for managers if you want to integrate with other plugins:
getConfigManager() - Access configuration
getPlayerDataManager() - Access player data
getTeleportManager() - Access teleportation logic
getCountdownManager() - Access countdown management
Configuration can be reloaded by calling the reload() method via other plugins.
Support
If you encounter any issues or have questions:
- Check the troubleshooting section above
- Review server logs for error messages
- Verify your configuration matches the examples
- Ensure you're using a compatible server version
License
Check the plugin's license file for information about usage and distribution.
评论 0
登录后参与评分
还没有评论,来抢沙发吧