Throw an arrow.

Discussion in 'Archived: Plugin Requests' started by aehoooo, Nov 7, 2011.

  1. Offline

    aehoooo

    Yes, a simple plugin, I do a /throw, or any command you want to put, and the player throws it, with full speed. If it can be done, with more speed than the deafult. If it is to hard, dont bother, just the command and arrow is ok.

    Can someone help me on this?
     
  2. Uh, do you mean shoot an arrow?
     
  3. Offline

    aehoooo

    Yes. But without bow or anything.
     
  4. Offline

    Phiwa

    Wait some minutes, I will create it for you.
     
  5. Offline

    aehoooo

    Ok, thanks :3
     
  6. Offline

    Phiwa

    Here you are. ;)
    Use /arrow to shoot an arrow. I might add to this and maybe allow players with a certain Permission-Node to enable/disable throwing and then throw by right-/left-click, but I do not have enough time for that at the moment.
    Busy with my other plugins.
     
  7. Offline

    aehoooo

    Thank you sir, you are very kind. Sorry to bother you again, but the arrow is not as fast as the bow, (they go half the distance of a bow) so they only hit the mobs, but do very little damage. Can you fix this?

    Also, if its no much to ask, but could you remove the "..." chat text on arrow shoot?

    Thank you very much.
    -aehoooo
     
  8. Offline

    Phiwa

    Oh, the chat text is my mistake. About the power of the shot, I will take a look at it, didn't test that yet. :)
     
  9. If you haven't found out how to change the speed then take a look at this :)
     
  10. Offline

    Phiwa

    I found it out and implented it, if I got some time I may add some more features, maybe a config to set the power Why do I always end up with projectiles being shot?!:oops:)

    Speed is now 5 times the old one.
    Download is here.

    Have fun, if you got any problem, simply tell me. ;)

    EDIT: In my plugin Mortar I used explosions, that's a different kind of "power". :)
     
  11. Offline

    aehoooo

    WOW thank you. This is way better that I expected. The arrow now goes very far, its just perfet for the crossbow I'm making with UltraItems. Thank you :3
     
  12. Offline

    Phiwa

    No problem mate. :)
    I was quite surprised how far it goes, if you multiply that by five again... Woooow. :eek:
     
  13. Offline

    mcclurya

    The link is broken. Could you send a new one?
     
  14. Offline

    Phiwa

    I don't have the file anymore, but the plugin only contained a few lines and was really stupid. :D
    Where is the sense in typing /arrow to throw an arrow?! :D

    EDIT: Just found the file, you can download it here. The only command is "/arrow".

    Sourcecode (open)

    Code:java
    1. package phiwa.Arrow;
    2.  
    3. import java.io.PrintStream;
    4. import org.bukkit.ChatColor;
    5. import org.bukkit.Server;
    6. import org.bukkit.command.Command;
    7. import org.bukkit.command.CommandSender;
    8. import org.bukkit.entity.Arrow;
    9. import org.bukkit.entity.Player;
    10. import org.bukkit.plugin.PluginManager;
    11. import org.bukkit.plugin.java.JavaPlugin;
    12. import org.bukkit.util.Vector;
    13.  
    14. public class Arrow extends JavaPlugin
    15. {
    16. PluginManager pm;
    17. public static ChatColor red = ChatColor.RED;
    18. public static ChatColor green = ChatColor.GREEN;
    19. public static ChatColor white = ChatColor.WHITE;
    20.  
    21. public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args)
    22. {
    23. if (!cmd.getName().equalsIgnoreCase("arrow"))
    24. return false;
    25.  
    26. if(!(sender instance of Player)) {
    27. System.out.println("Only available ingame!");
    28. return false
    29. }
    30.  
    31.  
    32. return false;
    33. }
    34.  
    35. public void onDisable()
    36. {
    37. System.out.println("ThrowAnArrow has been disabled!");
    38. }
    39.  
    40. public void onEnable()
    41. {
    42. this.pm = getServer().getPluginManager();
    43.  
    44. System.out.println("ThrowAnArrow has been enabled!");
    45. }
    46.  
    47. public static void throwArrow(CommandSender sender) {
    48. Player player = (Player)sender;
    49. Arrow arrow = player.shootArrow();
    50. Vector velo = arrow.getVelocity().multiply(5);
    51. arrow.setVelocity(velo);
    52. }
    53. }

     

  15. [​IMG]
    Seems like just yesterday
     
  16. Offline

    AndyMcB1

  17. Not to my knowledge
     

Share This Page