LoginCommand
LoginCommand allows you to execute commands when players join your server.
Concept
The plugin uses command groups. Each group can have a number of commands. If a player has the corresponding permission node for a command group, those commands will be executed when he/she joins the server.
The commands are executed from the console. You can also execute player commands by adding the "sudo %name_of_player%" prefix to a command.
You can set a delay.
You can set a cooldown.
If you want some players to be ignored (regardless of other permissions), you can do that by giving them a permission node.
Setup instructions
1. Download the plugin.
2. Copy the plugin into your server's plugin folder.
3. Start the server.
4. Create a command group and add commands to it.
Let's say that we want to give Helpers a diamond pickaxe as an award when they join the server. We come up with a group name, "helpergifts" to store these commands.
The generalized command to add a command is:
/logincommand add <new group name> <command>
In this case:
/logincommand add helpergifts give %name_of_player% diamond_pickaxe
5. Give somebody the permission of the command group.
Now we have to give the permission group "Helpers" a certain permission node.
In case you use PermissionEx, the command might look like this:
/pex group Helper add logincommand.group.helpergifts
6. Further configuration:
You can find some more settings (command delay, cooldown, whether op's are exempt) in the configuration file. After making changes, issue the /logincommand reload command.
Troubleshooting
If the plugin doesn't work:
- Make sure that the player doesn't have the exempt permission node. See the Permissions section.
- On default settings, operators are exempt. If you want the plugin to affect them, set the value of "ops exempt" to "false" in the configuration file, then issue the /logincommand reload command.
Commands
Root command and aliases:
/logincommand
/lic
/lc
Reload the configuration file:
/lc reload
Add a command to a command group; (also auto-creates the group):
/lc add <group> <command>
Remove a command from a command group:
/lc remove <group> <command>
Placeholders
When you add a command and specify a placeholder, the placeholder will be replaced on every execution with its corresponding value.
Valid placeholders are:
The name of the player who joins the server:
%name_of_player%
Permissions
logincommand.admin
description: Allows you to edit and reload the config.
default: operators
logincommand.exempt
description: The plugin will ignore your login.
default: Nobody, but if you have the * permission node (for example, your Admin group has it), Bukkit will report that you have this permission as well. Use negative permission nodes to counteract this.
logincommand.group.<group>
description: Group specific permission for command execution.
default: nobody
Example config
execution delay (sec): 1
login cooldown (min): 60
configversion (don't change): 2
ops exempt: true
# when the above is true, operators will be ignored
config:
group1:
- sudo <name> warp woods
helper:
- eco give <name> 10
timestamps (auto generated): []
The effects:
Players who have the logincommand.group.group1 permission will be teleported to warp woods after 1 second of their joining, if their last login was more than 60 minutes ago.
Players with the logincommand.group.helper permission will be given 10 units of money (the same delay and cooldown applies).
@adventuretc Hey man I was wondering if you could help me setup a config that allows me to eco give or give credits to a group once upon login. I'd really appreciate it like example would be I want to give all iron donators theie donator money but only one time not everytime they login
@brian163b
I couldn't reproduce the problem, I am setting the file state back to release. Please update your plugins and try again with only this plugin installed.
@brian163b
Sorry I had a busy week, I will check it in a day or so.
@brian163b
Anyone else seeing this?
Uh oh! Using 0.7 I am seeing a new problem. Commands are being executed for the first group, regardless of what permissions are set (even none). My config:
execution delay (sec): 1
login cooldown (min): 1
configversion (don't change): 2
config:
everyone:
- sudo <name> time
helpers:
- sudo <name> fly
If I remove all l logincommand permissions from all GroupManager permissions (and reload) it is still running time. If I give logincommand.group.helpers to a GroupManager group like "Moderators" only time still executes (not fly).
I can even rename "everyone" to "noone", /logincmd reload and upon login still get the time command. (Clearly proving it's busted.) :-(
@adventuretc
Awesome! Thanks for the quick turn around on a fix. I'll give the new version a try.
[Edit] That appears to have done the trick.
@xboxs7
Not yet, thanks for your kindness though :)
@brian163b
Thank you very much for reporting this bug! Fixed!
First and foremost, thanks for sharing your plug-in. ;-)
Second, it appears to be ignoring the login cool down. Commands are executing for my users (op and non-op) on each login.
execution delay (sec): 1
login cooldown (min): 5
configversion (don't change): 2
config:
everyone:
- sudo <name> checktime
timestamps (auto generated):
Bigxxxx: 23025736
Heroxxx: 23025735
ops exempt: false
I'm running 1.6.4.
<<reply 1807214>>
:D do you have some way i can pay you???
@xboxs7
Please install JRE 7.
when ever i start my 1.6.2 server it says this and loginCommand doesn't work
2013-10-02 16:47:20 [INFO] Starting minecraft server version 1.6.2
2013-10-02 16:47:20 [INFO] Loading properties
2013-10-02 16:47:20 [INFO] Default game type: SURVIVAL
2013-10-02 16:47:20 [INFO] Generating keypair
2013-10-02 16:47:20 [INFO] Starting Minecraft server on 192.168.0.102:25565
2013-10-02 16:47:21 [INFO] This server is running CraftBukkit version git-Bukkit-1.6.2-R1.0-b2879jnks (MC: 1.6.2) (Implementing API version 1.6.2-R1.0)
2013-10-02 16:47:22 [SEVERE] Could not load 'plugins\LoginCommand-0.6.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: me/speed/LoginCommand/LoginCommand : Unsupported major.minor version 51.0
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:184)
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:305)
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:230)
at org.bukkit.craftbukkit.v1_6_R2.CraftServer.loadPlugins(CraftServer.java:239)
at org.bukkit.craftbukkit.v1_6_R2.CraftServer.<init>(CraftServer.java:217)
at net.minecraft.server.v1_6_R2.PlayerList.<init>(PlayerList.java:56)
at net.minecraft.server.v1_6_R2.DedicatedPlayerList.<init>(SourceFile:11)
at net.minecraft.server.v1_6_R2.DedicatedServer.init(DedicatedServer.java:106)
at net.minecraft.server.v1_6_R2.MinecraftServer.run(MinecraftServer.java:391)
at net.minecraft.server.v1_6_R2.ThreadServerApplication.run(SourceFile:582)
Caused by: java.lang.UnsupportedClassVersionError: me/speed/LoginCommand/LoginCommand : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at org.bukkit.plugin.java.PluginClassLoader.findClass0(PluginClassLoader.java:80)
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:53)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:173)
... 9 more
2013-10-02 16:47:22 [INFO] [ProtocolLib] Loading ProtocolLib v2.4.5
2013-10-02 16:47:22 [WARNING] [ProtocolLib] Version (MC: 1.6.2) has not yet been tested! Proceed with caution.
2013-10-02 16:47:23 [INFO] [DisguiseCraft] Loading DisguiseCraft v4.9
2013-10-02 16:47:23 [INFO] [BKCommonLib] Loading BKCommonLib v1.54
2013-10-02 16:47:24 [INFO] [PropHunt] Loading PropHunt v1.34
2013-10-02 16:47:24 [INFO] [NoLagg] Loading NoLagg v1.90.2
2013-10-02 16:47:24 [INFO] [ProtocolLib] Enabling ProtocolLib v2.4.5
2013-10-02 16:47:24 [INFO] [ProtocolLib] Started structure compiler thread.
2013-10-02 16:47:24 [INFO] [BKCommonLib] Enabling BKCommonLib v1.54
2013-10-02 16:47:25 [INFO] [BKCommonLib] BKCommonLib is running on CraftBukkit (git-Bukkit-1.6.2-R1.0-b2879jnks) : v1_6_R2 (Minecraft 1.6.2)
2013-10-02 16:47:25 [INFO] [BKCommonLib] [Network] Now using the ProtocolLib library to provide Packet Listener and Monitor support
2013-10-02 16:47:25 [INFO] [BKCommonLib] Now a plugin, a new server implementation tomorrow???
2013-10-02 16:47:25 [INFO] BKCommonLib version 1.54 enabled! (0.41s)
2013-10-02 16:47:25 [INFO] Preparing level "world"
2013-10-02 16:47:25 [INFO] Preparing start region for level 0 (Seed: 2319461186784201414)
2013-10-02 16:47:26 [INFO] Preparing spawn area: 50%
2013-10-02 16:47:27 [INFO] [DisguiseCraft] Enabling DisguiseCraft v4.9
2013-10-02 16:47:27 [INFO] [DisguiseCraft] Version 4.9 is enabled!
2013-10-02 16:47:28 [INFO] [PropHunt] Enabling PropHunt v1.34
2013-10-02 16:47:28 [INFO] [PropHunt] loaded Seeker Effects List
2013-10-02 16:47:28 [INFO] [PropHunt] loaded Seeker Helmet
2013-10-02 16:47:28 [INFO] [PropHunt] loaded Seeker Chestplate
2013-10-02 16:47:28 [INFO] [PropHunt] loaded Seeker Leggings
2013-10-02 16:47:28 [INFO] [PropHunt] loaded Seeker Boots
2013-10-02 16:47:28 [INFO] [PropHunt] Loaded Seeker Class fully
2013-10-02 16:47:28 [INFO] [PropHunt] loaded hider Effects List
2013-10-02 16:47:28 [INFO] [PropHunt] loaded hider Helmet
2013-10-02 16:47:28 [INFO] [PropHunt] loaded hider Chestplate
2013-10-02 16:47:28 [INFO] [PropHunt] loaded hider Leggings
2013-10-02 16:47:28 [INFO] [PropHunt] loaded hider Boots
2013-10-02 16:47:28 [INFO] [PropHunt] Loaded hider Class fully
2013-10-02 16:47:28 [INFO] [PropHunt] PropHunt: 21 disgiuses loaded
2013-10-02 16:47:28 [INFO] [PropHunt] Prop Hunt settings Loaded
2013-10-02 16:47:28 [INFO] [PropHunt] prophunt arena loaded
2013-10-02 16:47:29 [INFO] [PropHunt] prophunt is using default arena Config
2013-10-02 16:47:29 [INFO] [NoLagg] Enabling NoLagg v1.90.2
2013-10-02 16:47:29 [INFO] [NoLagg Saving] will write world data to all region files every 12000 ticks (10.0 minutes)
2013-10-02 16:47:29 [INFO] NoLagg version 1.90.2 enabled! (0.687s)
2013-10-02 16:47:29 [INFO] Server permissions file permissions.yml is empty, ignoring it
2013-10-02 16:47:30 [INFO] Done (4.475s)! For help, type "help" or "?"
2013-10-02 16:47:34 [INFO] CONSOLE: Stopping the server..[m
2013-10-02 16:47:34 [INFO] Stopping server
2013-10-02 16:47:34 [INFO] [NoLagg] Disabling NoLagg v1.90.2
2013-10-02 16:47:34 [INFO] NoLagg disabled!
2013-10-02 16:47:34 [INFO] [PropHunt] Disabling PropHunt v1.34
2013-10-02 16:47:34 [INFO] [BKCommonLib] Disabling BKCommonLib v1.54
2013-10-02 16:47:34 [INFO] [DisguiseCraft] Disabling DisguiseCraft v4.9
2013-10-02 16:47:34 [INFO] [DisguiseCraft] Version 4.9 disabled!
2013-10-02 16:47:34 [INFO] [ProtocolLib] Disabling ProtocolLib v2.4.5
2013-10-02 16:47:34 [WARNING] DSCT: socket closed
2013-10-02 16:47:34 [INFO] Saving players
2013-10-02 16:47:34 [INFO] Saving worlds
2013-10-02 16:47:34 [INFO] Closing listening thread
2013-10-02 16:47:34 [INFO] Saving chunks for level 'world'/Overworld
2013-10-02 16:47:34 [INFO] Stopping server
2013-10-02 16:47:34 [INFO] Saving players
2013-10-02 16:47:34 [INFO] Saving worlds
2013-10-02 16:47:34 [INFO] Saving chunks for level 'world'/Overworld
@geode19
I am not sure, please post your config in PM. It might have problems with being op, try it as a regular user. Thanks for the feedback!
Hi adventuretc,
I'm just trying out this plugin on our 1.6.2. test server and it seems like it's ignoring the login cooldown value. I've got it set to 1440, which I think should only run the login commands every 24 hours, but they run every time I login. Any ideas?
Thanks!
@xinvisiblekiller
You could set the cooldown to a really large number, then delete that section of timestaps if you reset the map.
@adventuretc
Is there anyway to make it so the command only gets executed once? Like what I would want to do is make so said donator logs in and receives x amount of money and mcmmo credits apon logining for the first time after a map reset. I tried to use this plugin before but with no luck. Is there like a dev build or something I could try? If not thats fine I'll do everything manually for donators lol.
@xinvisiblekiller
It does.
Does this still work for 1.6.2? I really would like for my server. It seems like a good way to reward donators after a reset automattically.
@adventuretc
broken in plugin.yml
The upcoming 0.6 fixes the async task bug and is compatible with 1.6 versions (the plugin is upwards compatible so far).