我制作了这款小型插件,旨在解决新玩家在首次登录服务器时因卡在墙里、生成在屋顶等问题而死亡的情况。
它的工作原理是在玩家首次登录(或没有玩家数据文件)后,经过可配置的刻数延迟再执行一条命令。
我觉得应该把它上传到这里,以防有人觉得有用。因为我找不到能满足我需求的其他工具,所以自己做了这个。
config.yml
当你首次将插件放入服务器的 plugins 文件夹并启动服务器时,config.yml 文件会自动为你生成;在插件更新时,还会以默认值添加任何新的变量。
ticks: 20
在执行命令之前等待的刻数。
command: spawn
等待指定刻数后要执行的命令。
- 会将命令中出现的 PLAYERNAME 替换为玩家的名称。
- 会将命令中出现的 PLAYERUUID 替换为玩家的 UUID。
注意:如果你使用 spawn 作为命令,你需要一个提供该命令的插件,否则它将无法正常工作。
runas: player
输入 player 或 console 以选择由玩家本人还是控制台执行该命令。
span: 5000
玩家必须在线的毫秒数,以避免在加入时触发该命令。
prevent_new_logins: false
阻止新玩家登录。
prevent_message: "New players are not currently allowed to login. Please try again later."
向被阻止登录的玩家显示的消息。
Commands
/ffl prevent <on|off>
开启或关闭阻止新玩家登录的功能。默认:off(默认情况下允许新玩家登录)
/ffl reload
从磁盘重新加载配置文件。
Permissions
ffl.prevent
授予使用 /ffl prevent <on|off> 的权限
ffl.reload
授予使用 /ffl reload 的权限
ffl.all
授予所有 FixFirstLogin 权限。
注意:在 FixFirstLogin v1.4 之前,此权限为 ffl.*
Source
I made this little plugin to fix new players getting stuck in walls or spawning on roofs, etc. and dying when they first log into the server.
It works by running a command after a configurable amount of ticks when players log in for the first time (or they don't have a player file).
I thought I should upload it here in case someone might find it useful. I couldn't find anything to do what I wanted so here it is.
config.yml
The config.yml file should be automatically generated for you the first time you start your server with the plugin in your plugins folder and add any new variables on plugin updates with their defaults.
ticks: 20
The number of ticks to wait before running the command.
command: spawn
The command to run after waiting the number of ticks.
- Will replace any occurances of PLAYERNAME in the command with the player's name.
- Will replace any occurances of PLAYERUUID in the command with the player's UUID.
Note that if you use spawn as your command you should have a plugin that provides that command or it won't work.
runas: player
Enter player or console to choose to run the command as the player or as console.
span: 5000
The number of milliseconds the player must have been logged in to avoid the command being run when they join.
prevent_new_logins: false
Stops new players from logging in.
prevent_message: "New players are not currently allowed to login. Please try again later."
The message to display to players who are prevented from logging in.
Commands
/ffl prevent <on|off>
Turn on or off the preventing of new players from logging in. Default: off (new players can login by default)
/ffl reload
Reload the config from disk.
Permissions
ffl.prevent
Gives access to use /ffl prevent <on|off>
ffl.reload
Gives access to use /ffl reload
ffl.all
Gives all FixFirstLogin permissions.
Note: Before FixFirstLogin v1.4 this permission was ffl.*
Source
评论 0
登录后参与评分
还没有评论,来抢沙发吧