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

Discussion in 'Inactive/Unsupported Plugins' started by ayan4m1, Jul 25, 2011.

  1. Offline


    MultiArrow - Custom Arrow Types:
    Version: v0.9.8

    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.

    • 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
    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)
    • - Skip iConomy fee check (default: op)
    • - Skip extra material check (default: op)
    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.

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

        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:

        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:

        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 {
    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:
    Download MultiArrow v0.9.8
    [​IMG]Source Code

    Version 1.0
    • Add support for all projectile entities (snowball, slime) with custom effects
    Version 1.5
    • Allow all configurable options to be set per-world
    Version 2.0
    • Configurable effect classes/options, each of which modifies base effect behavior (for easier selection)
    • Integrate simple scripting engine (LUA?) to facilitate Javaless custom effects
    Version 0.9.8
    • Made compatible with CraftBukkit build 1060
    • Water created by water arrow is now temporary
    • Added send-balance-on-fee configuration option
    • Fixed exceptions generated by mobs firing arrows
    • Replaced old event detection code, significantly increased speed and lowered memory usage
    • Optimized event priorities to improve arrow type switching responsiveness
    • Refactored CustomArrowEffect to ArrowEffect, added TimedArrowEffect class for temporary/two-stage effects
    • Fixed invalid permission check for free-fees node
    • Fixed potential exception when doing required materials check
    • Improved log messages in configuration handler
    Version 0.9.7
    • Navigate backward by holding the sneak button
    • Fixed potential infinite loop on torch arrow hitting ground
    • Fixed invalid cast errors on survival servers (thanks mefisto1542!)
    • Added parsing for wool/ink data values (thanks Jade Knightblazer!)
    • Improved ground hit detection
    • Teleport arrow now sets player look pitch to 0
    Version 0.9.6
    • Fixed entities taking damage from arrows intermittently
    • Optimized event priorities
    Version 0.9.5
    • Completely overhauled ground detection, significantly improved responsiveness
    • Fixed bug where a drill arrow fired into snow caused an infinite loop
    Version 0.9.1
    • Fixed bug with last arrow type permission set to true resulted in exception during arrow cycling (thanks Jade Knightblazer!)
    Version 0.9
    • Added optional iConomy integration / configurable arrow use fee
    • Cleaned up code
    Previous Versions (open)

    Version 0.8.1
    • Explosive arrow now create EntityExplodeEvent/ExplosionPrimeEvent (fixes integration with explosive modification plugins)
    Version 0.8
    • Added 'multiarrow.infinite' permission for infinite arrows
    • More robust error handling
    Version 0.7
    • Added default config.yml creation
    • Made arrow removal user-configurable
    Version 0.6
    • Added Teleport arrow
    • Fixed effects triggering when arrow is fired straight up
    • Added snakeyaml and config.yml handling/parsing
    • Added optional "required item" for arrows
    • Cleaned up code
    Version 0.5
    • Added animal arrow, which spawns a random friendly mob
    • Changed light arrow to torch arrow
    • Torch arrow lights entities on fire
    • Fixed bug where light/torch arrow would not create a torch on top of snow
    • Explicitly unload async thread
    • Removed fire and sharp arrow types
    Version 0.3
    • Optimized memory usage
    • Clean up water/light arrows after their effect
    • Switched to dynamic class instantiation of CustomArrowEffect for increased modularity
    Version 0.2
    • Cleaned up BlockHitDetector, added reflection for custom arrows, added water/light arrow types
    Version 0.1
    • Initial release
    MaFiMa and BillabongBoy like this.
  2. Offline


    I think, the plugin is good, but the download is destroy :(
  3. Offline


    Apologies, internet outage to blame. I plan on moving the CI system (and thus the JAR download) over to a cloud server in the near future.
  4. Offline


    I need this Plugin!^^
    Pls make a working download :(

    Thank you :)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 17, 2016
  5. Offline


    Can I request (along with all the other lazy/non-Java technical people) for the Chicken Arrow to be a default option in the next build?
  6. Offline


    I have added the Animal arrow to 0.5, which spawns (randomly) a pig, sheep, cow, or chicken where it hits.
  7. Offline


    What happens if you use a teleport arrow on yourself (catch it from air)? :p
  8. Offline


    You will be teleported a few blocks in some random direction.

    I'm working on a new video to showcase all of the new arrow types and features.
  9. Offline


    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
  10. Offline


    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.

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


    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.

    Let me know if you're still having trouble after adding "multiarrow.use.all: true" to your PermissionsBukkit config.yml file.

    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.
    twiclo likes this.
  12. Offline


    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 :)
  13. Offline


    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)
  14. Offline


    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).

    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.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 17, 2016
  15. Offline


  16. Offline


    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.
  17. Offline


    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
    07:18:18 [SEVERE] Could not pass event PLAYER_INTERACT to MultiArrow
            at com.ayan4m1.multiarrow.ConfigHandler.getRequiredTypeId(ConfigHandler.
            at com.ayan4m1.multiarrow.MultiArrowPlayerListener.onPlayerInteract(Mult
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
            at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEven
            at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEven
            at net.minecraft.server.NetServerHandler.a(
            at net.minecraft.server.Packet15Place.a(SourceFile:57)
            at net.minecraft.server.NetworkManager.b(
            at net.minecraft.server.NetServerHandler.a(
            at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
            at net.minecraft.server.MinecraftServer.h(
  18. Offline


  19. Offline


    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?
  20. Offline


    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"
  21. Offline


    Woot, one less other plugin :) thank you

    Well the download link goes to an error.... and i had another idea...

    I noticed with my trigger happy self that i would not check the last type of arrow i would use, maybe add an option to "sneak"+ left click to change types?

    (ex. left click to hit a door, then a hostile is behind the door, and then boom tnt arrows destroy the house... lol)

    Also noticed when you fire, there is a double arrow?

    Hmm another thought.... sorry for all the thoughts, but this one doesnt seem to work well with "creeperheal"

    it heals the land or buildings after a creeper or tnt goes boom... but doesnt seem to pick up a tnt arrow, maybe the way it is being triggered, i will post about it on creeperheal's thread as well

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 17, 2016
  22. Offline


    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.
  23. Offline


    Awesome :) thank you so much for looking into that and making it all work

    Any thought on my suggestion for Sneak+left click option in the config to cycle arrow types?
  24. Offline


    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.
  25. Offline


    Ok so I tested for a bit, the holes are not being filled by creeper heal, redownloaded and installed both plugins, made sure the config was right for creeper heal, still no go.

    The hole can be drilled with just one arrow, not a bunch as i first thought.

    And the arrows are still being consumed, and i removed the other plugin for infarrows

    EDIT, i guess it took another reset, or the /ch reload feature for creeper heal is not working

    the holes being drills seems to have stopped as well.... not sure the cause then

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


    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?

    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.
  27. Offline


    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
  28. Offline


    hey i have a problem, i can choose only the normal, lightning, explosive and razor arrow. why i cant choose the other ones? please help
  29. Offline


    it's a setting in mcMMO that limits the arrow fire rate. I believe if you set it to 0 it disables it
  30. Offline


    but i want to fire that fast... as in mcmmo
    it fires normally. i tested it

Share This Page