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

Command summary page

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.

You must login to post a comment. Don't have an account? Register to get one!

  • Avatar of Jabelpeeps Jabelpeeps May 22, 2014 at 09:38 UTC - 0 likes

    Hi,

    I am an Op on my favourite sever, and I'm trying to use your plugin to run an op command on the death of a player (a /scoreboard command). In case it is relevant, the server is running 1.7.9 on spigot/bungeecord.

    I can set up the op command no problems, and then attach it to a button, where I can then use it as desired, even when de-op'ed.

    Where I run into problems, is when I then try to attach the same op command to a death event. It works fine when I am op'ed. But when I am de-op'ed a message appears about not having the required permissions - the same message that appears if I try to do the /scoreboard command in chat when de-op'ed. The same happens when I try to attach the op command to a respawn event.

    I'm not a java programmer, but since this is open source, I thought I'd have a look at the code, and see what I could see. I think I've found a possible error/typo, though I've no idea if this is responsible for my problem. Looking at line 40 of death.java (scram8888's version if there is any difference), and comparing it to line 33, there is a difference, with the pattern of line 33 being followed in the other classes (e.g. line 89 & 93 of Join.java). I wonder if the line should read:-

    else if(plugin.getCommandMap().get(command + "[op]") != null){

    Unfortunately the comparable lines in respawn.java do not show the same (possible) typo, so I fear my issue is not solved by the change I have suggested...

    Thanks for reading.

  • Avatar of AppleSnipe AppleSnipe Mar 10, 2014 at 13:48 UTC - 0 likes

    And if you gonna update i hope you do pls pm me

  • Avatar of AppleSnipe AppleSnipe Mar 10, 2014 at 13:45 UTC - 0 likes

    This plugin seems realy nice and i can use for my server but my server is CB 1.7.2 Pls update pls,pls,pls,pls

  • Avatar of 567legodude 567legodude Feb 06, 2014 at 04:20 UTC - 0 likes

    Could you also add the ability to add a command for when a player respawns? Not just for when they die but also when they respawn?

  • Avatar of Samueljuhasz Samueljuhasz Jan 22, 2014 at 17:26 UTC - 0 likes

    can you also add, just before a server restart?

    My french server IP: MineRP.minecraft-home.com

  • Avatar of SylvainSSiri SylvainSSiri Jan 20, 2014 at 02:37 UTC - 0 likes

    Hi there!Nice plugin! I was wondering if you would be kind enough to include execute a command when someone leaves the server.This is something I would really use, but I cannot find it anywhere.You are already close to it, since you can execute when people join.

    I would be very thankful! Thanks!

    Sylvain

  • Avatar of gecko16300 gecko16300 Nov 17, 2013 at 21:21 UTC - 0 likes

    Hello, is there variables for commands ? Exemple :

     /addopcommand TNT_spam give @p 46 64
    

    or

    /addopcommand TNT_spam give <player> 46 64
    

    Thank you in advance !

    FactoryCraft

  • Avatar of xXBadeye xXBadeye Nov 04, 2013 at 10:51 UTC - 0 likes

    @littlegruz: Go

    I'm sorry that i am replying so late but I have another problem now... My method worked, til the 1.6.2 update. Now i am being spawned to the world standard spawn, and after a second or 2 the /respawn is executed and i am beeing spawned at one of the respawn locations. The delay between both spawns is realy annoying. I don't know why it appears now and worked previously, but anyways the GLOBAL variable is still not working. My steps: assigning an identifer to a command: /addacommand spawn /respawn /setrespawncommand spawn GLOBAL Those to steps result in: "No player found with that name."

    The plugin is working with my delayed method, so it has nothing to do with my bukkit version...

    Edit: My method (at page 2 currently, I've described how i bypassed the GLOBAL variable) has nothing to do with the delay. When i assign the command for only myself, the command is executed 1-2 seconds after the actual respawn. The delay problem is therefor code based.

    Edit2: Would it be possible to add an "item right click" option? So like when i right click with a book (not pointing at something, just holding the book in my hands and right clicking) it performs a command just like it does with the onjoin commands and on death commands?

    Last edited Nov 05, 2013 by xXBadeye

    BFAK:100480,49aa403a2fb1dc2e65f6f3e43bf52c5ce23aab7229f6e7208a221b482655a1cf

  • Avatar of TheOnlyRealTGS TheOnlyRealTGS Oct 17, 2013 at 21:46 UTC - 0 likes

    its not /displaystartupcommand its /displaystartupcommands in the desc

    Owner of MC-Simple Gaming! Hope to see you there :)
    Need a free BuyCraft alternative? Try MinecraftMarket! | Need a great Spleef plugin? Try HeavySpleef!

    http://minecraft-mp.com/regular-banner-17943-3.png

  • Avatar of socram8888 socram8888 Oct 15, 2013 at 17:05 UTC - 0 likes

    For those getting ConcurrentModificationExceptions or the like from repeating commands, get my fixed version here: https://github.com/socram8888/Autorun-Commands

Facts

Date created
Oct 25, 2011
Category
Last update
May 05, 2013
Development stage
Release
License
BSD License
Curse link
Autorun Commands
Downloads
13,065
Recent files
  • R: v3.2.4 for CB 1.6.2-R0.1 May 05, 2013
  • R: v3.2.3 for CB 1.5.1-R0.1 Apr 07, 2013
  • R: v3.2.2 for CB 1.4.7-R1.0 Feb 24, 2013
  • R: v3.2.1 for CB 1.4.7-R1.0 Feb 14, 2013
  • R: v3.2 for CB 1.3.1-R1.0 Jul 22, 2012

Authors