Inactive [FUN/DEV] MultiArrow v0.9.8 - Custom Arrow Types [1060]

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.

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.

Code (Text):

materials:

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!):

Code (Text):

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:

Code (Text):

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:

Code (Text):

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.

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:

Code (Text):

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.

i respect your work, but i dont know what to do with this plugin. my players would destroy the world accidentally or would just dont use it. But the exploding arrows and the animal arows are awesome!
well, its not very useful but funny to have i think

Can someone help me? i got the plugin and i left click with the bow and it will only select normal. i tried typing /multiarrow.use.all but that did nothing.

Click to expand...

There are no commands to use. The problem is most likely that you are not using the new permissions system added to CraftBukkit recently. MultiArrow uses the new Bukkit "SuperPerms" system and does not integrate with the "Permissions" plugin. To fix the issue, op yourself (/op <name> from the console) or give yourself the SuperPerms permission node "multiarrow.use.all". For more information on the new permission system, please read this thread. If you need to migrate from Permissions 2.x/3.x, I recommend using SpaceManiac's fantastic PermissionsBukkit plugin and spending a few minutes transliterating your config files.

And also, what would happen if you hit someone else with a teleport arrow?

Click to expand...

If you hit another player (or entity) with a teleport arrow, it will be teleported several random blocks away. It could certainly be annoying if given to all players on a public server. Using the new permission system you can set multiarrow.use.all to true and then multiarrow.use.teleport to false to prohibit that one arrow type.

Also, because you didn't mention, I have assumed you are using CraftBukkit build 1000. If you are using 953 or any version that is not 1000, you will not be able to get PermissionsBukkit working. As a result, this plugin does not support builds earlier than 1000.

ok sir help needed please! : ) i had the version before this one and it worked fin but then i upgraded and now all my mods cant use the arrows they select them but they cant use them for some reason. I gave them the multiarrow.use.all node in the permissions.yml. what is going on? please help me

There are no commands to use. The problem is most likely that you are not using the new permissions system added to CraftBukkit recently. MultiArrow uses the new Bukkit "SuperPerms" system and does not integrate with the "Permissions" plugin. To fix the issue, op yourself (/op <name> from the console) or give yourself the SuperPerms permission node "multiarrow.use.all". For more information on the new permission system, please read this thread. If you need to migrate from Permissions 2.x/3.x, I recommend using SpaceManiac's fantastic PermissionsBukkit plugin and spending a few minutes transliterating your config files.

If you hit another player (or entity) with a teleport arrow, it will be teleported several random blocks away. It could certainly be annoying if given to all players on a public server. Using the new permission system you can set multiarrow.use.all to true and then multiarrow.use.teleport to false to prohibit that one arrow type.

Also, because you didn't mention, I have assumed you are using CraftBukkit build 1000. If you are using 953 or any version that is not 1000, you will not be able to get PermissionsBukkit working. As a result, this plugin does not support builds earlier than 1000.

Click to expand...

awsome thanks! i havent updated to the new version yet (silly me)

K, its all working now! great plugin! thanks so much for your help youre so awesome!
could you please consider making a few changes though?
get back an arrow after tp (it just disapears)
make a torch placed by arrow become an arrow after its broken. (that would rock)

ok sir help needed please! : ) i had the version before this one and it worked fin but then i upgraded and now all my mods cant use the arrows they select them but they cant use them for some reason. I gave them the multiarrow.use.all node in the permissions.yml. what is going on? please help me

Click to expand...

Can they not use all arrow types, or only a few? Do the players get any kind of message when they try to fire the arrows? Can they fire arrows when the selected type is Normal? You're setting "multiarrow.use.all: true" for each moderator individually?

Also, just to make sure we rule out the simple stuff, make sure you're using CraftBukkit build 1000, and check your server log for any errors or exceptions that get printed out when the players try to fire a custom arrow (posting these would be helpful in determining that there is a bug and how to fix it).

could you please consider making a few changes though?
get back an arrow after tp (it just disapears)
make a torch placed by arrow become an arrow after its broken. (that would rock)

Click to expand...

Glad you got it working. I have added configuration options to control which arrows get removed and which can be picked back up in version 0.7. I like the second idea, but it would make the plugin less efficient... I may make this an optional feature as well.

i respect your work, but i dont know what to do with this plugin. my players would destroy the world accidentally or would just dont use it. But the exploding arrows and the animal arows are awesome!
well, its not very useful but funny to have i think

Click to expand...

You can use the Bukkit's permission system to restrict access so that only moderators/admins/ops can use the more destructive arrow types. You can also now configure it so that any arrow requires a second item to use (glowstone dust to use a lightning arrow for example).

This plugin was created to be used in conjunction with War, so it was never really intended to be usable by all of a public server's players simultaneously. In any event, I agree that this plugin isn't for all servers and/or players and appreciate the feedback.

Can they not use all arrow types, or only a few? Do the players get any kind of message when they try to fire the arrows? Can they fire arrows when the selected type is Normal? You're setting "multiarrow.use.all: true" for each moderator individually?

Also, just to make sure we rule out the simple stuff, make sure you're using CraftBukkit build 1000, and check your server log for any errors or exceptions that get printed out when the players try to fire a custom arrow (posting these would be helpful in determining that there is a bug and how to fix it).

Click to expand...

ok I have set "multiarrow.use.all: true" in the permissions.yml and gave them the permissions.yml node for mods which is mod.commands and all other stuff works just not multiarrow and they get no message when trying it the can select the explode arrow or anyother it just doesnt let them use it (it only shoots normal arrows). here is the error when they try it. PLEASE HELP ME my mods are getting impatient lol xD

Code (Text):

07:18:18 [SEVERE] Could not pass event PLAYER_INTERACT to MultiArrow

java.lang.NullPointerException

at com.ayan4m1.multiarrow.ConfigHandler.getRequiredTypeId(ConfigHandler.

java:18)

at com.ayan4m1.multiarrow.MultiArrowPlayerListener.onPlayerInteract(Mult

iArrowPlayerListener.java:48)

at org.bukkit.plugin.java.JavaPluginLoader$10.execute(JavaPluginLoader.j

ava:307)

at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav

a:58)

at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j

ava:332)

at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEven

t(CraftEventFactory.java:168)

at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEven

There are no commands to use. The problem is most likely that you are not using the new permissions system added to CraftBukkit recently. MultiArrow uses the new Bukkit "SuperPerms" system and does not integrate with the "Permissions" plugin. To fix the issue, op yourself (/op <name> from the console) or give yourself the SuperPerms permission node "multiarrow.use.all". For more information on the new permission system, please read this thread. If you need to migrate from Permissions 2.x/3.x, I recommend using SpaceManiac's fantastic PermissionsBukkit plugin and spending a few minutes transliterating your config files.

How do I allow use of all arrow types to everyone? I never had a permissions before the update and i still dont (i assume that i dont) so i typed "multiarrow.use.all" into the permissions.yml file and still only ops have permission to all arrowtypes.

First, great plugin, nice and simple... only downside, I use infarrow, so I never run out of arrows, and now that I am using yours, it seems to prevent infarrow from doing its thing, anychance at getting an option for OPs or a permission node to have unlimited arrows?

First, great plugin, nice and simple... only downside, I use infarrow, so I never run out of arrows, and now that I am using yours, it seems to prevent infarrow from doing its thing, anychance at getting an option for OPs or a permission node to have unlimited arrows?

Click to expand...

I will add a permission node that will stop arrows from being consumed soon. Thanks for the idea.

EDIT: Added the feature to version 0.8. The permission node is "multiarrow.infinite"

it heals the land or buildings after a creeper or tnt goes boom... but doesnt seem to pick up a tnt arrow

Click to expand...

I looked at the CreeperHeal source code and it seems that the documentation stating that it could heal "...all other types of explosions (from other plugins)" is not entirely accurate. Specifically, CreeperHeal registers for the ENTITY_EXPLODE event to detect explosions. My first thought is that the event is never firing because the arrow is not explicitly the entity causing the explosion. The explosive arrow type uses the standard World.createExplosion method to make the explosion.

I have confirmed that this seems to be the case, and I have modified my code to trigger an explosion which CreeperHeal can detect and repair. I have tested this with the latest release of CreeperHeal. Make sure you have updated to MultiArrow 0.8.1 and that "replace-magic-explosions" is set to true in your CreeperHeal config.yml.

The bottom line is that any explosion created by calling World.createExplosion does not create an EntityExplodeEvent, which seems to be the only way CreeperHeal can detect an explosion. As far as I am aware CraftBukkit would need to be modified to support an event for explosions without a related entity. Therefore, CreeperHeal cannot currently handle all plugin-based explosions as it claims to be capable of. That said, I got it working, so all's well that ends well.

I may add options to let you control the activation criteria for the cycle and fire actions. In the specific scenario you explained, I don't see how sneaking would make a difference. If you left clicked on the door, it shouldn't fire an arrow or create an explosion; holding down Shift wouldn't make that action any safer. If you're holding down the left mouse button to cycle through multiple arrow types, I would recommend just clicking rapidly instead, as this prevents a block/door from being potentially broken.

I may modify the explosive arrow so that it cannot go off within two blocks of the shooter. Several of my testers have blown themselves up in a variety of comical ways.

Generally, I would like to clean up the way these events are handled, so it is something I will give some attention to in the near future.

All other arrow types and features work fine except for the Drill arrow not working at all (when fired at both entities and the ground)? If so, what version of the plugin are you running? Are you getting any exceptions or errors printed to the server log when you fire a Drill arrow?

I noticed there is a config for multi arrows, are they suppose to be blank?

Click to expand...

No, it shouldn't be blank (although this shouldn't necessarily cause problems). If you have an empty config.yml in plugins/MultiArrow, delete it and let the plugin make a new template for you (reload or restart the server). Upgrading to 0.9 (should be ready in a day or two) will require you to re-create this file as well.

You can use the Bukkit's permission system to restrict access so that only moderators/admins/ops can use the more destructive arrow types. You can also now configure it so that any arrow requires a second item to use (glowstone dust to use a lightning arrow for example).

This plugin was created to be used in conjunction with War, so it was never really intended to be usable by all of a public server's players simultaneously. In any event, I agree that this plugin isn't for all servers and/or players and appreciate the feedback.

Click to expand...

now its awesome! thanks
I was not sure if it is the right thing for my rpgworld! but we have jobs, so i can make an explosive archer or a chickenarcher!
AND THIS WORKS awesome with the /md disguise creeper command!
FINALLY I can transform someone into a creeper witch can explode!
thank you
edit: is there a conflict with mcMMO? in mcmmo you shoot slow