萨罗的随机生成

萨罗的随机生成

动态随机玩家生成系统

Header

一个简单的 Minecraft 模组,当玩家首次加入服务器时,将其传送到随机位置。

description

  • 随机首次出生点:玩家首次加入服务器时会被传送到随机位置
  • 安全传送:高级算法确保玩家安全地生成在地表,而非洞穴、墙壁或危险区域中
  • 风景出生点选项:玩家可以在高空生成,并附带缓降效果,以欣赏新家的风景
  • 可配置设置:服务器管理员可以自定义传送设置
  • 可自定义消息:配置传送玩家时显示的消息
  • 可选重复传送:可选择在每次加入时传送玩家,而不仅仅是首次加入
  • 玩家例外:配置不应被传送的玩家白名单/黑名单

Configuration

该模组包含一个配置文件,你可以调整以下内容:

  • 距离出生点的最小和最大传送距离
  • 是每次加入时传送玩家,还是仅在首次加入时传送
  • 传送玩家时显示的自定义消息(默认禁用)
  • 安全传送开关(确保玩家不会生成在危险区域)
  • 风景出生点选项(玩家在高空生成,并附带缓降效果)
  • 维度特定传送设置(下界和末地传送选项)
  • 应从随机传送中排除的玩家列表

以下是配置文件示例(randomspawn-common.toml):

[general]
    # Minimum distance from spawn to teleport players (in blocks)
    minDistance = 500
    # Maximum distance from spawn to teleport players (in blocks)
    maxDistance = 2000
    # Whether to teleport players on every join, not just the first time
    teleportOnEveryJoin = false
    # Whether to allow teleportation in the Nether dimension
    allowNetherTeleport = false
    # Whether to allow teleportation in the End dimension
    allowEndTeleport = false

[messages] # Whether to show a message to players when they are teleported showTeleportMessage = false # Message to show to players when they are teleported teleportMessage = "You have been teleported to a random location!"

[safety] # If true, ensures players are teleported to safe locations (not in lava, caves, etc.) safeTeleport = true # If true, players will spawn at Y=100 with slow falling effect and gently float down to the ground spawnHighWithSlowFalling = false

[debug] # If true, enables detailed debug logging to help diagnose issues debugMode = false

[exceptions] # If true, only players in the list will be teleported. If false, players in the list will NOT be teleported. useWhitelist = false # List of player names to whitelist or blacklist from teleportation playerExceptions = ["ExamplePlayer1", "ExamplePlayer2"]

Commands

  • /newspawn - 将你自己传送到随机位置(需要 OP 权限)
  • /newspawn <player> - 将指定玩家传送到随机位置(需要 OP 权限)
  • /newspawn @a - 将所有玩家传送到随机位置(需要 OP 权限)
  • /newspawn @r - 将随机一名玩家传送到随机位置(需要 OP 权限)
  • /newspawn @p - 将最近的玩家传送到随机位置(需要 OP 权限)

该命令支持所有玩家选择器(@a、@p、@r、@e[type=player]),并可一次传送多名玩家。

项目支持与使用

主机托管:为获得最佳性能,我推荐使用横幅中链接的 BisectHosting。

整合包:你可以自由地将我的作品包含在任何整合包中。请确保通过提供此项目页面的链接来给予适当的署名。