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 [email protected] 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()));
    }
}

Comments

  • To post a comment, please or register a new account.
Posts Quoted:
Reply
Clear All Quotes

About This Project

  • Project ID
    72813
  • Created
    Jan 19, 2014
  • Last Released File
    May 22, 2014
  • Total Downloads
    1,533
  • License

Categories

Recent Files