萨罗的随机生成

萨罗的随机生成

动态随机玩家出生系统

游戏机制

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。

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

https://server.sarocesch.de/refersaro.php