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


    It was the explosion arrows that were "drilling" down to the bedrock, but the issue fixed itself after the last restart, so I am sure that is something that I did.

    • But it is still using arrows and not being infinite.

    And about the config:


    this is what i have, but should there be values in there?

    Any word on the double arrows being fired or is that intended
  3. Offline


    There is no razor arrow in my plugin. Are you thinking of EffectiveArrows?

    Make sure the multiarrow.infinite permission is set to true. Unlike multiarrow.use.all, it does not default to true for ops (it must be explicitly set in your Bukkit permissions). If checking that doesn't fix anything, what other plugins are you using?

    There don't have to be any values, just the empty nodes. That file is out of date, however, so you should delete your config.yml and let the plugin re-create a new one for you.

    Does this happen only when you fire Normal arrows, or all the time? Are you sure you're using version 0.8.1?

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


    I am the admin on the server so, in the permissions i have '*' for all

    The config was deleted and remade and the config file is still there.

    And yes, all the arrows i fire seem to fire a 'real' arrow and then the 'effect' arrow, both fired at the same time
  5. Offline


    okay i deleted the effective arrow plugin but now i cant choose anything...
  6. Offline


    You need to be an op to have default access to all arrow types. You also need to provide much more information if you want any help.

    CraftBukkit version
    MultiArrow version
    Other plugins you have installed
    MultiArrow config.yml contents
    Server startup log / errors or exceptions in your server log

    I don't have a lot of time to provide support this week. I will try to help, but it does seem like you've just installed this plugin and are expecting it to magically work without reading any of the documentation.

    There are NO '*' permission nodes for the new permissions system. I just explained in my last reply that EVEN if you are operator/admin, you will not have 'multiarrow.infinite' by default. You MUST add the specific permission "multiarrow.infinite: true" before it could possibly work. I will try to spell this out more clearly in my documentation.

    Does it have the exact same contents that you pasted last time? If so, then you should upgrade to the latest version of MultiArrow, as it would seem you're using an old version. Otherwise, if the config file did change (even if it's still relatively empty), you are all set.

    I am unsure as to why this is happening. I had noticed that the Normal arrow would fire two arrows in some cases, but I never got two arrows with any other arrow selected. Are there any errors that occur in your server.log when you get the second arrow?

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


    Hmm... then i misunderstood, i use 'permissions 3.x' and i saw the info about the change but I guess i figured that it would have been the same, but I will look into it

    and no, there are no errors that I can find about the second arrow, I figured it was needed for the plugin to work, so it was more a random question :)
  8. Offline


    no permissions 2.7.x support :(
    please add this! the people on my server want to explode as a creeper!
    if you add the permissionssupport, you are a god! thanks
  9. Offline


    Seems bukkit changed permissions.... all the nodes are updated, so you may need to use a new permissions plugin
  10. Offline


    Sorry, I have no plans or intent to support Permissions 2.x or 3.x. I would similarly implore you to consider upgrading to PermissionsBukkit and the new Bukkit permissions API.

    Why are you still using a discontinued and out-of-date plugin to provide arguably the most important feature (namely, auth/permissions) to your server?
  11. Offline


    Yea only downside is not i have to redo permissions for about 40 plugins... and it is sad they got rid of the '*' permission... made things so much easier to jsut test a plugin rather then having to add the permissions just to test.

    If you might add anything, maybe an OP flag to override the need for permissions? but that is just a hope
  12. Offline


    Bukkit didn't add an implicit definition for the * permission node, but plugin developers can add such a node. I may add a multiarrow.* permission node, but I am slightly hesitant. If my nodes were strictly "this node gives you permission to use this command/feature," then I would have added a multiarrow.* node initially. However, some nodes (free-materials and free-fees) technically take away features (skipping the check for those config options), and as such it could get confusing, with server admins asking me why users don't have to pay fees just because they have "multiarrow.*".

    I'm still thinking about it in any case.

    Also, just so it's clear, someone has been made into an op with /op <name>, they automatically get all multiarrow permissions except for multiarrow.infinite.
  13. Offline


    I'm new to MC servers, I need a detailed walkthrough, how to set the permissions. What do I need to do exactly?

    I tried the things mentioned on the top, I think I did something wrong. I want that, all the people could use only lightning, and explosive arrows. That's all. I want to use it with War plugin.
  14. Offline


    yea the only reason that the infinite is a thorn in my side is cause of VoxelSniper, it uses the arrow as a tool, and so i try to keep it on my bar, but then i have a happy trigger finger and find myself having to readd arrows alot.

    Sorry for being picky and such, just really like your plugin and have been looking for one that doesnt require me to have wool, or tnt, or anything but a bow and arrows in my inv.

    Thank you
  15. Offline


    First off, whenever you edit a .yml file, make sure you NEVER hit the Tab button. If you have a tab character in your yml it will not work. Use four spaces instead.

    You should read this thoroughly:

    That link will give you information and a tutorial as to how to set up Bukkit permissions generally. For my plugin specifically, read my OP and find the permission nodes. multiarrow.use.arrowname is the general node format for allowing players to use a given arrow. So, for your use case, we would make our PermissionsBukkit/config.yml look something like this:

                multiarrow.use.all: false
                multiarrow.use.lightning: true
                multiarrow.use.explosive: true
    That will make a player named "ayan4m1" only capable of using the Normal, Lightning, and Explosive arrows. People who are opped have access to all the arrow types by default, so if you want your admins to only have access to one or two arrow types, you will have to explicitly set "multiarrow.use.all: false" as I have above. The above example will only configure permissions for a single user. If you want to give permissions to a group of users, that is possible using PermissionsBukkit, but please try to figure it out for yourself (hint: read the wiki article I linked you to) before asking me for more help.

    Happy to help, but I don't think I understand your point... are you still having trouble with the permissions? If so, I would recommend reading this:

    Set up PermissionsBukkit and use that to give your users multiarrow.infinite. See the above example if it is unclear.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 17, 2016
  16. Hi, thank you so much for creating this Mod firstly!!! Now to the point. I am having problems with a few things about your Mod.

    1. Setting items ids such as: 351:4 Lapis lazuli, or any other items with xxx:x causes a item can't be found error.

    2. Would it be possible to disable switching arrow types if you don't have req mats?
    Atm selection is Normal>explo>lightning>Drill>Water>ect>Normal. but if you don't have the Mats needed it could only toggle threw the ones you can fire.
    No Mat for lightning and water. so Normal>explo>Drill>ect>Normal.

    3. Currently having issues with allowing players to only having a few arrow types. via multiarrow.use.<arrowtype>
    Admins with your use.all have no problems cycling threw the arrow types, however anyone with limited selection get stuck on last type of arrow in their permissions (bukkit).
    so it goes. Normal>lightning>drill>teleport>stuck (error in console screen has something about player can't interact with multiarrows.

    4. Lastly. Is there any future support for explo arrow recovery (maybe a creeper event type and tnt type ?) so my creeperheal fixes the holes.

    5. Chance to polish up water arrows, where the water brick will despawn after a 5 secs. Enough time for it to flow then fade away ( to many water arrows flooding)

    Thanks for your time
  17. Offline


    (note to self and all else, be carefull who you trust with explosion arrows)
  18. Offline


    At the moment, my item lookup doesn't support dyes or colored wool, as it doesn't parse the "id:data" format. This would be a good thing to add, thanks for bringing it to my attention. I created an issue on GitHub so that you (or anyone else) can track the status of this feature.

    At present I am hesitant to do this. My thought is that a user should be able to set their arrow type to explosive, happen upon some gunpowder, and then be able to use the explosive arrow right away. If it skips over the invalid options at the time, then you'd have to cycle around once more after getting the item before being able to use the arrow. I may consider changing this in the near future, but I need to think about it a bit more.

    You certainly found a bug. It is fixed in version 0.9.1. Thanks for reporting it!

    The latest version should work fine with CreeperHeal. I got it working and tested it myself a day or two ago. My guess is that the "replace-magic-explosions" setting in your CreeperHeal configuration is not set to true. Please let me know if it is set to true, you've reloaded/restarted, are running MultiArrow >=0.9 and are still having that issue.

    My intent was to allow users to construct permanent water using that arrow type, essentially obviating the need for multiple water buckets to create a river or pond. However, I have noticed similar problems with this. I may change it to be temporary soon, or wait until I have arrow groups implemented, at which point you would be able to choose between a permanent and temporary water arrow without just making the list of arrow types longer. Either way, a temporary variant will be available in time.
  19. Runs prefectly as is. I did indeed had magic explosions set to false on Creeperheal. Thanks for all your replies!
  20. Offline


    Thanks for the answer, finally I could figure it out, how it works, it is really great now! You, and that article helped, I could set it up, how I wanted, all the people have only explosive, and lightning arrow (later, I'll try to set that the explosive needs gunpowder).
  21. Offline


    best mod ever!
    friends dont have to use zombe anymore and makes everything faster
  22. Offline


    Yea waiting for them to have the converter for permissions 3.x to the correct format cause.... i reallllly dont wanna have to hunt down all the permissions nodes again, i only have 30+ plugins and 6 different user groups lol, but i do understand the set up and will be doing that soon.

    Thank you for such an awesome and customizable plugin :)
  23. Offline


    Um... Rip off of EffectiveArrows even the source is eerily similar to mine... Not saying that you did rip my plugin off just an observation.
  24. Offline


    I wanted to use your plugin on my production server but was dissatisfied with the quality of the code, as I was getting an ArrayIndexOutOfBoundsException when trying to use it.

    I replied to your thread reporting the bug and asking if you would post the source code and you said "As far as the source code goes just use a decompiler, I will try to put a github up soon." So I decompiled your plugin, looked at how it worked, then waited. You never added anything to GitHub, so after a week I wrote a similar plugin from scratch. I used the ideas presented in your work to create an undeniably cleaner, faster, more capable piece of code.

    You still don't have any code on GitHub and it seems like your plugin still suffers from some fairly large bugs. If I just copied your code wholesale and just changed the name, I could understand why you would accuse me and/or be upset. However, my code can detect arrow hits without a repeating task! I've added iConomy integration. I keep my plugin thread up-to-date and I am actively developing this plugin, with new features planned that should keep me busy for weeks.

    I had no intent to rip off your work or take over your plugin. If you had posted your code on GitHub I would have happily forked it and started submitting pull requests, but you didn't, so I went ahead and took the initiative, and then only after you told me to decompile your code to try and fix bugs. I never copied your code directly, and it should be clearly evident that this plugin provides new features, better performance, and more robust documentation.

    I'd like to apologize for not consulting with you more on the issue as I was developing this plugin. Frankly, it seemed like you were not planning on investing the time required to keep EffectiveArrows moving forward, but I should have let you know my intent.
  25. Offline


    I'm perfectly fine with your creating of a competing plugin I just wished you would have told me before-hand, if I had known that your intent was to help further the development of the plugin instead of just finding a small bug which I fixed in an hour I would have been more than happy to add you to the Github so you could. I'm just saying that if you decompiled and looked at my source just add a small note saying that you did so, that is all I am asking. Seeing that you picked up on the numerous trick I used to detect arrows hitting blocks, the entire user-interface, and the class based system for arrows I would like a little credit for providing inspiration/providing the source you learned from, that is all. Now here is a suggestion: I have been working on many new experimental features (hence the lack of updates) I say we work together and create the one and only arrow plugin.
  26. Offline


    That is entirely reasonable. I will amend my thread to that end.
  27. Offline


    Just wanted to update you and let you know that this is tested and working in 0.9.7. Make sure you put the id:data inside single quotes, as the colon will break your config file otherwise (see my example in the original post under Configuration). Enjoy!
  28. Offline


    Any idea what could be causing this?

    Plugins: AutoClear, BOSEconomy, DungeonBuilder, Essentials, EssentialsSpawn, FalseBookBlock, FalseBookCore, FalseBookExtra, FalseBookIC, HeroicDeath, LogBlockQuestioner, mcMMO, MineBackup, MinecraftViewer, OtherBlocks, PermissionsEx, Spout, Tombstone, VanishNoPickup, WirelessRedstone, WorldBorder, WorldEdit, WorldGuard, MobDisguise, Modifyworld, Permissions, Citizens, dynmap, LWC, Factions, Jobs, LogBlock, MobArena, MyWolf
    [SEVERE] Could not pass event PROJECTILE_HIT to MultiArrow
    java.lang.ClassCastException: org.bukkit.craftbukkit.entity.CraftSkeleton cannot be cast to org.bukkit.entity.Player
        at com.ayan4m1.multiarrow.MultiArrowEntityListener.onProjectileHit(
        at org.bukkit.plugin.RegisteredListener.callEvent(
        at org.bukkit.plugin.SimplePluginManager.callEvent(
        at net.minecraft.server.EntityArrow.m_(
        at net.minecraft.server.World.entityJoinedWorld(
        at net.minecraft.server.WorldServer.entityJoinedWorld(
        at net.minecraft.server.World.playerJoinedWorld(
        at net.minecraft.server.World.cleanUp(
        at net.minecraft.server.MinecraftServer.h(
  29. Offline


    Yes, that'd be a bug. I have updated the current download and source code with a fix. Thanks!
  30. Offline


    I just re dowloaded but its still doing it, am i suppose to do something else?
  31. Offline


    K so I am back :p

    But I have a small issue, i finally got the permissions changed over to permissionsbukkit, and the inf arrow seems to still consume arrows, but when I am out of arrows in my inventory, I am still able to shoot. This is awesome that it doesnt require "real" arrows... but as I mentioned before, I use a plugin called VoxelSniper and one of the tools is the arrow, so... I kinda need an arrow on my bar :(

    So if it is intended to not need an arrow, can it be made to not consume them please?[arrow]

    Also, no sound effect for shooting when there are no arrows on me, and when I do have arrows from picking up "normal" arrows, the sound is there and I start firing 2 arrows per shot.

Share This Page