RealArrows
Notice! The latest version if this plugin should work up through 1.7.9 and will possibly work beyond that.
Makes arrow physics more realistic when shooting while moving. Normally, when you shoot an arrow, it starts with the same speed no matter how fast you're moving, meaning that its velocity relative to the player is different depending on how fast the player is moving! Really bad physics. This plugin makes it so your velocity is factored into the arrow's velocity when you shoot, just like how it is in real life. It also affects skeletons and other arrow-shooting entities. As a bonus feature, you can optionally set a speed multiplier on the arrows.
Examples:
- You're falling from y = 9000 and shooting arrows straight down. Normally, they'd fly right into you or go above you. With this plugin, they'll go straight down ahead of you.
- You're on a horse, minecart, or boat, shooting arrows ahead of you. Normally, you could be hit by your own arrow very easily. With this plugin, that will not happen; the arrow will fly in front of you like it should.
Installation and Configuration:
- Be careful that you don't have plugins that could conflict with this. This plugin's event handler should fire last, but if another plugin that deals with arrow velocity also takes highest priority, it could cause problems.
- Place the plugin in your plugins folder; reload.
- Inside the RealArrows folder in the plugins folder, there is config.yml for setting the arrow speed multiplier (defaults to a normal 1.0).
Commands and Permissions:
- None.
- None.
Known Problems
- Due to problems in Mojang's code, arrows with very high speeds may behave strangely. I tried shooting down at full power while falling very quickly, and I couldn't see the arrows I was shooting until they landed. They also sometimes appear to fly to the left or right when they're moving very quickly but actually hit the proper location. I cannot fix this.
- Any other plugin that handles the EntityShootBowEvent with highest priority could possibly conflict with this plugin if it multiplies or performs some other non-addition operation on the arrow's velocity. Though a plugin that does that shouldn't take highest priority anyway.
- Any other plugin that handles the EntityShootBowEvent without "monitor" priority could be broken if it relies on knowing the arrow's velocity, such as a plugin that automatically aims bows. But those plugins should already use "monitor" priority for such event handlers.
Version History
- 1.2: Added configuration in config.yml for setting arrow speed multiplier.
- 1.1: Fixed event listener priority to avoid conflicts with other plugins.
- 1.0: Initial release.
Bug Reports:
- Leave a comment below if you find plugins that conflict with mine.
- Leave a comment below if there are any bugs I should know about.
Source and Contact
- You can email me at morshu9001@icloud.com since I don't use anything like GitHub for my Eclipse projects. It's very simple, and I'll give it out to anyone for any reason. But if you just want to see the one event handler this plugin uses, here it is:
public class RAFireEventHandler implements Listener { @EventHandler(priority = EventPriority.HIGHEST) public void bowShot (EntityShootBowEvent evt){ if (evt.isCancelled()){ return; } evt.getProjectile().setVelocity(evt.getProjectile().getVelocity().multiply(RAMaster.multiplier)); evt.getProjectile().setVelocity(evt.getProjectile().getVelocity().add(evt.getEntity().getVelocity())); } }
-
View User Profile
-
Send Message
Posted Feb 5, 2015Good work!
-
View User Profile
-
Send Message
Posted Jun 14, 2014@fatso9000
This is so simple and genius! Awesome work!
-
View User Profile
-
Send Message
Posted May 22, 2014@DjSwifPanda
Done :) Once Bukkit Dev approves of my uploaded JAR, version 1.2 will have this. It's not exactly what this plugin is meant for, but setting the speed multiplier high and sniping stuff is too fun to resist.
P.S. Woa, I didn't even see this message until a month later. Sorry, I've been so busy with my iPhone app that I haven't even visited this site. This feature took me like 5 minutes to add just now, not a whole month.
-
View User Profile
-
Send Message
Posted Apr 21, 2014could you possibly add a config to allow the arrows to go further, or faster? (at a set speed/velocity) if at all possible?
-
View User Profile
-
Send Message
Posted Feb 25, 2014Great plugin. Keep it up.
-
View User Profile
-
Send Message
Posted Jan 22, 2014@CommodoreAlpha
Thanks, glad to hear you like my plugin. I also realized another potential conflict with something like an auto-aim plugin that should actually fire its event handler AFTER mine (because it should know the final velocity), but there's already a "monitor" priority above "highest" that is reserved for event handlers that do not modify the event at all. I just hope that anyone who makes a plugin like that remembers to use "monitor".
-
View User Profile
-
Send Message
Posted Jan 21, 2014@fatso9000
Thanks for the response.
So I'm guessing it's just a matter of priorities, and which plugin edits the arrow's velocity first. If I run into any incompatibility issues, I'll let the respective developers know. Once again, thanks for the info and this plugin. ;)
-
View User Profile
-
Send Message
Posted Jan 21, 2014@CommodoreAlpha
Actually, it could cause problems in some cases. For example, if the plugin that doubles the arrow's velocity does it with an event priority higher than mine, it'll double the velocity after my plugin has already added the player's velocity, resulting in unrealistic physics. I just tested and confirmed this. For that reason, I'm uploading a new plugin that has the event priority set to highest just in case⦠though it's also the other plugin-maker's job to set his priority to lowest so the arrow's velocity is doubled before anything else. And if the other plugin's priority is set to highest, problems could still occur. Plus I was using the default package, which could also cause conflicts, so I changed that.
Also, I'm marking my plugin as "beta" now since it's embarrassing to find a problem in a release version.
-
View User Profile
-
Send Message
Posted Jan 20, 2014Would this interrupt other plugins that modify arrow velocity?
(e.g. an arrow plugin could introduce a new type of arrow which has doubled velocity)