FixFirstLogin
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.*
Hey can you update the source on GitHub with the latest version?
@danielfr789
I uploaded a new version which hopefully works with Spigot 1.8 properly.
Actually yes, just about to report that it doesn't work. If you need the error: http://pastebin.com/UUquc7G9
Just PM me the spigot 1.8 version.
@danielfr789
Are you using this with Spigot 1.8? I may have to release a new version for Spigot 1.8.
Perfect plugin! Exactly what I needed. Thank you ryvix :)
very nice plugin! thanks!
FixFirstLogin v1.3
Thank you for the plugin!
@ryvix
Awesome! Thank you very much! This solved everything!
@DruidKiria
I just uploaded version 1.2.1 which lets you replace PLAYERNAME in the command with the player's name.
@DruidKiria
Ah I see. I will add a variable to replace the players name.
@ryvix
I though of that, but I have two spawns, one for first time players (with rules, so it's kinda important), and one for old players, more practical.
HSP has /setspawn and /setfirstspawn, but only /spawn, and no /firstspawn. The issue is if i put the command as spawn, ALL players are going to spawn on first spawn point on death.
Really don't know what to do! I guess it's better to set one spawn for everyone while I can't fix it.
@DruidKiria
Ah I see, you want <player> to be replaced with the player's name. I probably could make it replace something with the player's name in there. Right now it doesn't do that.
However, does HomeSpawnPlus have a /spawn command which sends the player to spawn? If so you could just leave the config as default and see if that works.
@ryvix
Excellent! I had to download it. This thing is bothering me so much. But yet, I couldn't fix it. Looks like console is not doing the command. I have this as my config.yml:
ticks: 20 command: 'warp <player> spawn' runas: console span: 5000
Is it because of the command? I have HomeSpawnPlus installed, which also didn't helped fixing this issue, is that it?
@DruidKiria
Yes, it will run a command after a configurable number of ticks when a player joins the server. Once the player has been logged in for a total span of time (5 seconds by default) then it will no longer try to run this command anymore.
For example, if a player joins but sees they are in a wall and immediately logs out within 1 second their total logged in time should still not be more than 5 seconds and if they come back and stay longer than the number of ticks the command should be run as long as after the number of ticks is up it still hasn't been 5 seconds.
It could also work if a player gets disconnected when trying to log in the first time, or takes a second to actually finish logging in, etc. then once they stay connected longer than the number of ticks configured in the config, as long as they have not been logged in for a total span of 5 seconds altogether then the command will run.
It may seem like overkill to have the number of ticks before the command runs and the total time they should be logged in before deciding not to run the command but in my testing this is how it was necessary for it to actually work properly.
The default values probably should work fine but I've only tested it on a couple servers so they are configurable if anyone wants to tweak them. Experimentation might be necessary.
I'm sorry if i missed something, but is the command run only when the player first logs in? I have this first login spawn issue, but not general spawn...
I uploaded 1.2 which adds 2 new config variables which are explained above, runas and span. These should be added to the config with their default values as shown above when you restart the server with the updated plugin in the plugins folder.
I noticed this is far too actuate in measuring the time so I am going to release an update to allow more time. It works fine on my test server but on some remote servers it will take a number of milliseconds to perform the connection (maybe equal to your ping to the server or something) and so I am adding a config option for that allowance which will default to 5 seconds. This means that if people have not been logged into your server for 5 seconds yet then the command will be run.
I think I will also add a config option to run the command as either the player or as console. So then as an example you could add something like "tp ryvix 150 64 -200" as the command and set it to be run as console to teleport someone to a set of coords, depending on your teleport plugin of course.
@seiterseiter
Does your spawn have anything around or above it? Have you ever moved your spawn?
I have not ever got this problem. I wonder why?