Filled Timed Snowball Command Trigger

Discussion in 'Archived: Plugin Requests' started by dhore, Oct 28, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    dhore

    Plugin category: Miscellaneous

    Suggested name: SnowballCommandTrigger

    What I want: When a player throws a snowball it will 'fly' for 1 second, if it hasn't hit anything yet when 1 second is up then the co-ordinates of that snowball at that time will be stored, the snowball will then be removed/despawned, and the plugin will trigger a command as the console with the ability to use the stored location of the snowball in arguments with the selected command.

    The command that will be run after that 1 second should be specified in a config file. And that config file should also contain a commented line explaining how the snowball location variables should be used in the command arguments.

    Quick Example:
    • Player throws snowball.
    • Timer waits for 1 second.
    • Location (X,Y,Z) of snowball is stored in variables (locX, locY, locZ).
    • Snowball is removed/despawned.
    • Command (specified in config file) is run as the console -> eg. /tp Bob locX locY locZ <-(using previously stored snowball location).

    I have searched extensively through dev.bukkit for a plugin that does the above, but even though it should be very simple to make, it doesn't exist yet (probably because it is very specific in the way I need it to work).

    Ideas for commands: No commands needed for this plugin. Command from another plugin that will be triggered should be set in a config file, not with commands.

    Ideas for permissions: No permissions needed for this plugin. Everyone should be able to throw a snowball and trigger it.

    When I'd like it by: As soon as you can possibly make it :) Thank-you in advance!
     
  2. Offline

    Watto

    I can do this, just quickly though, do you want the code to be ran which is specified in the config, and the locX, locY and locZ be replaced at run time with the actual coordinates?

    EDIT**

    I'm assuming this is how you want the config to be laid out?

    Code:
    Command to run: tp {player} {locX} {locY} {locZ}
    Delay in seconds: '1'
    
    Then say the snowball is thrown by me you want the console to issue the following command:
    Code:
    tp watto2010 310 15 115
    Random coordinates but you get the point :)
     
  3. Offline

    dhore

    Well... I don't actually need the player that threw it for the command.... but if you would like to implement that as another variable, then go ahead :) as it could be useful!

    And yes, the Config has a line where I can specify the command that I want the console to run.
    And specifying the Delay in Seconds works for me too :)

    So the player throws the snowball, the plugin waits the specified delay, removes the snowball and executes the command.

    The locX, locY and locZ is the position that the snowball was at when the Delay (1 second) was reached.

    Thank-you for doing this btw Watto :)
     
  4. Offline

    Watto

    dhore
    I already made it, i just wanted to make sure i made it correctly xD.
    I'll leave the player variable in as then you can actually call commands which require a player name (such as tp)
    Download Here!
    Please run once to allow for the config.yml to generate ^^
    Just note the {} around the variables must be there in the config or the variable won't be detected / changed.
    Anyway i believe this is what you asked, feel free to Tahg me if there's something you didn't want in here or there's something you need adding :)
     
  5. Offline

    dhore

    Thank you so, so much Watto !!! :D
    It works perfectly! (so far :p )
    You made it within 4 hours of me requesting it too! Amazing :)
     
  6. Offline

    Watto

    Awesome, I'm glad it works. Feel free to get in contact with me if you have any issues! :)
     
  7. Offline

    au2001

    dhore Don't forget to mark this as filled ;)
     
    dhore likes this.
Thread Status:
Not open for further replies.

Share This Page