Autorun Commands
Want to execute a command which displays stats just by right clicking the desired player? Or how about giving them a rose or 64 many, many times with ease? Or even make a command run which kicks players if they walk over a certain block? You can do that and more with this mod!
Features:
- Allows the execution of a command simply by right clicking on a player.
- Allows the execution of a command simply by walking over a block.
- Allows the execution of a command simply by pressing a stone button.
- Allows the execution of a command simply by dying
- Allows the execution of a command simply by respawning
- Allows the execution of a command at server start up
- Allows the execution of a command on a regular interval
- Allows the execution of a command when a player join
How to use:
Step 1:
- Assign a command to an identifier.
- For this example, we want to say 'Hello <playername>!' and we will assign it the identifier "wassup"
- type: /addacommand wassup say Hello potato!
- Adding the word 'potato' will substitute the name of the player who is the target of the event
OR
- Assign an OP command to an identifier.
- For this example, we want to give me 64 TNT blocks and assign it the identifier "TNT_spam"
- type: /addopcommand TNT_spam give LittleGruz 46 64
Step 2:
- Assign the identifier to an appropriate event.
- For this example we will assign "TNT_spam" to occur every 10 minutes (600 seconds) and to assign "wassup" to be run when a player right clicks another player
- type: /setclickcommand wassup GLOBAL
- NOTE: The use of the word GLOBAL (all caps) means that when anyone right clicks someone, "wassup" will be run instead of just me running it
- type: /addrepeatcommand TNT_spam 600
Step 3:
- Watch them trigger!
- Now if I right click someone called "Bruce". I will execute the command '/say Hello Bruce!'
- And every 10 minutes I will get a full stack of TNT
Future plans:
- Sleep
If you have any comments or questions, please head on over to the forums.
View the source here. Check out the main website here.
Apparently, the lovely Socram8888 has fixed an error in my code that produces ConcurrentModificationExceptions. Get it from Github here.
may i please get a copy of your source? id like to see how it is made so i can maybe try to keep it uptodate? i use a plugin that requires this for giving items out when people login
Pleas help?
[WARNING] [AutorunCommands] Task #237281 for AutorunCommands v3.2.4 generated an exception java.lang.NullPointerException at littlegruz.autoruncommands.listeners.CommandPlayerListener$1.run(CommandPlayerListener.java:137) at org.bukkit.craftbukkit.v1_6_R2.scheduler.CraftTask.run(CraftTask.java:58) at org.bukkit.craftbukkit.v1_6_R2.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:345) at net.minecraft.server.v1_6_R2.MinecraftServer.t(MinecraftServer.java:518) at net.minecraft.server.v1_6_R2.DedicatedServer.t(DedicatedServer.java:239) at net.minecraft.server.v1_6_R2.MinecraftServer.s(MinecraftServer.java:481) at net.minecraft.server.v1_6_R2.MinecraftServer.run(MinecraftServer.java:413) at net.minecraft.server.v1_6_R2.ThreadServerApplication.run(SourceFile:582)
hey nice plugin. when is it gonna be updated to 1.6.2?
You can add the possibility that when a player (with permissions) left or right clicks on an item in his hand the server run a command?
PD: Sorry for my bad English,im from Argentina :P
I had hoped that this wouldn't have happened so soon, but after much deliberation, I have decided that I am no longer able to maintain my plugins.
Could you not run the commands from the player? They run from the console and so do not need permission...
Error: http://pastebin.com/KqdWMFcp Please help me!
For me, all of the commands are lost when I restart the server. Anyone else experiencing this? Please help, otherwise, great plugin, thanks!
@xXBadeye
Wow. I did not realise that sort of thing could work. Good work!
Having a look at the code, respawning commands looks like it should support GLOBAL. Did you use the command like "/setrespawncommand spawn GLOBAL" or did you just use it like you described without specifying the optional player parameter?
Hey, i tried to assign the command /setrespawncommand to every player. Without GLOBAL in the end it worked, but just for me. The plugin can't find a player named GLOBAL (yes, it was case sensitive). So how can you/I fix it? I really need this... i want to respawn every player on death with a custom plugin which allows me to randomspawn them... again, for me it worked but I'm the only one who is affected by this command.
FOR EVERYONE WHO HAS PROBLEMS WITH "GLOBAL":
I've managed it to bypass it. first you need your command, which you want to get executed for everyone. for me its a command called /respawn. I want everybody who respawns to execute this command.
Step1:
/addacommand spawn respawn <--- this will create the identifer spawn to execute the command /respawn.
/setrespawncommand spawn <--- this forces you to respawn ehn you die, you use teh predefined command one line above.
The problem now is, that adding behind /setrespawncommand [command] the player GLOBAL is not having any effect. We can bypass it with the next step:
Step2:
/addacommand onjoin setrespawncommand spawn <-- combining the command /respawn and a new alias for it.
/addjoincommand onjoin <--- this will add for EVERY palyer who respawns the command onjoin, which is spawn, which is /respawn, which means every palyer will automaticly execute the command /respawn when he respawns! Congrats, you just bypassed the GLOBAL playername :D
@littlegruz: I am failing badly.. I try to make that if someone dies they respawn with a book. I did /addacommand book give 403 1 <player>, then /addstartupcommand book . I am sure that I am doing something wrong or the plugin needs an specific player.. And thank's for the great plugin ideea :D
@Chopperrino
Nope. Pretty much everything (unless stated) is OP only. I am glad you find it useful, I will try to keep it updated.
Do you have any permission nodes?
Thank you, Thank you, Thank you! I've been looking for plugins like this everywhere, even found some, but none were updated. I really hope you keep it updated! Thanks
@littlegruz
Thanks, but I'm using this one that I found it easier.
http://dev.bukkit.org/server-mods/onjoincommand/
Thanks!
@euQsei
First you would create the identifier i.e. /addopcommand tele_join tp potato [world_spawn_coordinates]
Then you would attach the identifier to either one of the join commands e.g. /addjoincommand tele_join
What would the command be if I wanted everyone who joined to be spawned at the main world?
@GBoutlaw
There is currently no delay for commands to run
Hi this is a great and useful plugin, but I have a little suggestion.
It is possible to add a adjustable delay to run a command. Example: if you stay more than 2-3 seconds on a block, "the block" run a command.
Thanks.
New version (3.2.4).
Hopefully fixes those errors from the posts below. If not, please tell me (at least) what the original command being run is i.e. what is the plugin the command is from.