MultiArrow

This plugin would not be possible without the work of skeletonofchaos. Thank you!

Left-click while holding a bow to select the next arrow type. Right-click to fire the selected arrow type. If you hold down the Sneak button (Shift, by default) when left-clicking, you can select the previous arrow type.

Features:


  • Uses Bukkit permissions
  • Simple to use (no commands, configuration optional)
  • Extensible (developers can add their own arrow types easily)
  • Can give player(s) infinite arrows
  • Optional per-arrow required material
  • Optional per-arrow fee (requires iConomy 5.x)

    • Included Arrow Types:

  • Explosive - Small explosion at the destination
  • Lightning - Lightning strikes the destination
  • Drill - Creates a hole under block/entity, great for catching animals
  • Water - Creates small patch of water at the destination
  • Torch - Places a torch at the destination or lights an entity on fire
  • Animal - Spawns (randomly) a pig, cow, sheep, or chicken at the destination
  • Teleport - Teleports you to the destination or a hit entity to a random destination

    • Permissions:
      NOTE: This refers to Bukkit permissions, not the Permissions plugin. There are no '*' nodes in the new system, so you cannot give a user 'multiarrow.*'.

You need to use the new Bukkit permissions system with this plugin. An excellent migration guide is available here. It will save you time and hassle down the road, as Permissions is no longer the safest, simplest way to protect your server.


  • multiarrow.use.all - Allows users to use all arrow types (default: op)
  • multiarrow.use.<name> - Allows users to use the <name> arrow type
  • multiarrow.infinite - Infinite arrows! (default: false)
  • multiarrow.free-fees - Skip iConomy fee check (default: op)
  • multiarrow.free-materials - Skip extra material check (default: op)

    • Configuration:
      NOTE: If you are upgrading from MultiArrow v0.9.7 or earlier, please backup/delete your config.yml and allow MultiArrow to create a new one, as it has changed since then.

If you desire, you can require a user to pay one unit of a given item to use a given arrow type. To do this, simply edit your MultiArrow/config.yml using the template below as a guide. To add a new requirement, simply add a line with the arrow type name as the key and the type id of the item as the value. Currently, you may only set one id for a given arrow type. If you want to use colored wool or dyes for this purpose, append a colon and the data value and then wrap it in single quotes (e.g. '35:4' for yellow wool). If you omit the quotes, the colon will break your config file until it is removed or properly quoted.

requirements:
    lightning: 348
    explosive: 289
    teleport: '35:4'
    torch: 263

You can also add lines to the remove-arrow section of your config.yml to control which arrows are removed after their effect triggers. The default is true for all arrow types (i.e. all arrows are removed after the effect triggers), so you should only ever set something to false here. Here's an example that allows you to reuse teleport arrows (thanks twiclo!):

remove-arrows:
    teleport: false

If you use iConomy 5.x, you can charge players a fee to fire a given arrow type. Note that you MUST include a decimal point with all costs ("50" is incorrect, "50.0" is correct). The following is an example of how to configure this feature:

fees:
    teleport: 500.0
    animal: 10.75

If you are using the fees functionality and would like the users to get a message containing their updated balance whenever a fee is charged, set the option below to true:

options:
    send-balance-on-fee: true

Custom Arrow Types:
You can easily add your own arrow types with a few lines of Java code. Get a copy of my source code from GitHub and then add your own class to the package com.ayan4m1.multiarrow.arrows. For the sake of example, let's say we want to create a Chicken-spawning arrow.

public class ChickenArrowEffect implements ArrowEffect {
	public void onEntityHitEvent(Arrow arrow, Entity target) { }
	public void onGroundHitEvent(Arrow arrow) {
		arrow.getWorld().spawnCreature(arrow.getLocation(), CreatureType.CHICKEN);
	}
}

Then, add your class name to the ArrowType enum. For example, if "ChickenArrowEffect" were the name of our class, we would add the following to ArrowType:

public enum ArrowType {
	NORMAL,
	CHICKEN
}

The plugin will automatically provide that type name as an option to the user, and will dynamically instantiate and run your ArrowEffect onEntityHitEvent/onGroundHitEvent methods whenever a user fires one of your arrows.

If you have written a stable, interesting arrow type, reply here with a link to the source or submit a pull request from your personal fork to my GitHub repository.

Download/Source Code:
http://i56.tinypic.com/1zcjuig.pngSource Code


Comments

Posts Quoted:
Reply
Clear All Quotes

About This Project

Categories

Members

Recent Files

Bukkit