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.*
oh okay thanks for the reply :) I will wait then :P
@NaoTwo
The Bukkit staff hasn't approved it yet.
Download link to 1.1? :)
I really could need it :D
I just uploaded v1.1 to make it work again in 1.3.
It now will compare the current time to the time the player first logged in to see if the command should be run or not instead of using the hasPlayedBefore method.
Please report any issues =)
@ryvix
Thanks for the reply.
I submitted a ticket about the random 10 block radius spawning issue with the other plugins dev. They should fix it within their plugin, i shouldnt have to find another plugin to fix the others shortcomings.
@omgitsmit
It should be possible to detect if a command is run and then run some other command after but I'm not so sure this will work for all cases. What if the /register command fails? In that case it still sounds like the plugin you're using to register them should be modified to teleport them some place after a successful registration.
I could make it detect when a command is run and teleport them to specific coords. Then by default it would have a backup for when /spawn is run it teleports them to wherever the coords are set to. However, if another plugin is teleporting them on top of where it should that sounds like maybe something else is going on.
@ryvix
Well then they /register they are spawned on top of the house. I wanted to use this to force them to spawn inside the house where /spawn is located. So instead of your plugin using ticks to force them to that block, i was curious if you could have it force them to the block after the /register command.
@omgitsmit
Are you are saying you want to trigger a command after some other plugin registers them? If so that sounds like you would have to modify that other plugin to run a command after it registers them.
I have this problem after a user /registers their account with our login manager. Is it possible to add "command" instead of "ticks'?
AWESOME fix, great idea. My users always spawn outside of the spawn. Thanks :)