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

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

  1. Offline

    ayan4m1

    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.



    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.

    Code:
    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:
    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:
    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:
    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.

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

    Roadmap:
    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
    Changelog:
    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

    masterjohn12

    this be happening to me to
     
  3. Offline

    ayan4m1

    I rushed and only partially fixed the code - try updating and reloading/restarting once more if you don't mind.
     
  4. Offline

    mefisto1542

    Its still doing it, it could be my problem, im not sure.

    Hum now that i look at it its different

    Code:
    2011-08-09 01:07:50 [SEVERE] Could not pass event ENTITY_DAMAGE to MultiArrow
    java.lang.ClassCastException: org.bukkit.craftbukkit.entity.CraftSkeleton cannot be cast to org.bukkit.entity.Player
        at com.ayan4m1.multiarrow.MultiArrowEntityListener.onEntityDamage(MultiArrowEntityListener.java:64)
        at org.bukkit.plugin.java.JavaPluginLoader$58.execute(JavaPluginLoader.java:649)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:332)
        at net.minecraft.server.EntityArrow.m_(EntityArrow.java:183)
        at net.minecraft.server.World.entityJoinedWorld(World.java:1198)
        at net.minecraft.server.WorldServer.entityJoinedWorld(WorldServer.java:48)
        at net.minecraft.server.World.playerJoinedWorld(World.java:1180)
        at net.minecraft.server.World.cleanUp(World.java:1104)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:447)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
     
  5. Offline

    ayan4m1

    This is actually not expected behavior - that is, you shouldn't be losing arrows if the infinite permission is set. Would you mind posting your MultiArrow config.yml and/or the relevant section(s) of your PermissionsBukkit config.yml?

    You're right, it is different - and as far as I can tell the second fix that I made should have resolved the issue you just posted. Is it possible that you got a cached copy from the CDN, didn't copy the right version of the JAR, that the file didn't get overwritten, or that there are multiple MultiArrow JARs in your plugin directory? I have tested the latest version available from the thread and I no longer get the errors when skeletons fire arrows.

    Thanks for reporting the issue, hopefully we can get it working for you.

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

    mefisto1542

    Fixed, its not doing it anymore, thx.
     
  7. Offline

    fatmarley

    @ayan4m1 has anyone mentioned freeze arrows? IF not...
     
  8. Offline

    ayan4m1

    No, I don't think that idea has been discussed yet. Would your implementation create ice blocks or just make it so that a player cannot move for an interval?
     
  9. Offline

    fatmarley

    I would like it so they cant move for an adjustable interval.

    Thank you!!!!

    P.S. And maybe an iceblock at their feet, just for humorous effect?
     
  10. Offline

    Kill3rMcTavish

    the explosive arrow doesn't work @ayan4m1
     
  11. Offline

    ayan4m1

    It doesn't work for you... What version of CraftBukkit are you using? Are you using PermissionsBukkit? What version of this plugin do you have? Have you modified the MultiArrow config.yml at all? If so, please post it as well. Are there any errors in your console when you try to use an explosive arrow? Does the arrow itself not fire, or is there simply no explosion?
     
  12. Offline

    Sneaky420

    Config:
    requirements:
    remove-arrow:

    Plugins list:
    [​IMG]
     
  13. Offline

    Kill3rMcTavish

    i use craftbukkit v. 1000 . yes, i have insert in my plugins folder the "permissionbukkit" here . i don't have modified the config.yml of multiarrow plugin becase i was see it run well (except the explosive). The console don't make me any error and yes, the arrow is fired but it's don't make any explosion :( ...


    PS

    i have also "permissions" , it's can be possible a conflict between this and "permissionsbukkit"? if yes, how can i set up this? this plugin is to be given only at the donors group, not at the default group.



    thanks in advance :)
     
  14. Offline

    ayan4m1

    Have you set any MultiArrow permissions in the PermissionsBukkit config.yml?

    There shouldn't be any conflicts between PermissionsBukkit and Permissions, if that's what you mean. MultiArrow does not support the "Permissions" plugin, it only supports the Bukkit permission API (which is commonly extended using PermissionsBukkit). Just bear in mind that MultiArrow permission nodes placed in the "Permissions" plugin config files do absolutely nothing. You should put MultiArrow permissions in the PermissionsBukkit config.yml, never in a config file in the "Permissions" folder.

    If you want to get rid of Permissions easily, you can install SuperpermBridge (by the same author as PermissionsBukkit, SpaceManiac), then add "superpermbridge.<permissions node name>: true" to your PermissionsBukkit config.yml for each of your old Permissions nodes. Then you can test removing Permissions, as the bridge plugin and updated PermissionsBukkit config.yml should interface with all plugins that support Permissions but not the new system. Once more developers start getting users requesting a change to the new system, you'll see most of your plugins start to support PermissionsBukkit natively, and eventually you can get rid of SuperpermBridge as no plugins will continue to use the old system.
     
  15. Offline

    Sneaky420

    KK, gonna work on that today and report back if it is still an issue
     
  16. Offline

    Sneaky420

    K, so I completely redid permissions, only using permissions bukkit, got rid of permissions3.x and still it is consuming arrows and firing "fake" arrows when I am out in my inv. Not a big impact, but figured I would report back as I said
     
  17. Offline

    Mercury

    @ayan4m1
    My config.yml seems to empty oO
    #1060
    Code:
    materials:
    remove-arrows:
    fees:
    
     
  18. Offline

    ayan4m1

    That is the correct default config file. All of the configuration is optional, so that is what you start off with. There is a relatively in-depth explanation of how to configure each section at the top of this thread under Configuration.

    However, currently I think the plugin is not fully compatible with CB 1060. I am currently with very limited internet access. I just got the new RB about 20 minutes ago - I'll be pushing out a compatibility update soon.

    EDIT: Version 0.9.8 is more compatible with build 1060. It is also significantly faster and more memory efficient, so you should update as soon as possible.
     
  19. Offline

    gabriel11798

    i get this error filling my server log:

    2011-08-29 17:16:56 [SEVERE] Could not pass event ENTITY_DAMAGE to MultiArrow
    java.lang.NoSuchFieldError: PROJECTILE
    at com.ayan4m1.multiarrow.MultiArrowEntityListener.onEntityDamage(MultiArrowEntityListener.java:111)
    at org.bukkit.plugin.java.JavaPluginLoader$58.execute(JavaPluginLoader.java:649)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:332)
    at net.minecraft.server.Entity.burn(Entity.java:652)
    at net.minecraft.server.Entity.move(Entity.java:601)
    at net.minecraft.server.EntityLiving.a(EntityLiving.java:520)
    at net.minecraft.server.EntityLiving.v(EntityLiving.java:704)
    at net.minecraft.server.EntityMonster.v(EntityMonster.java:26)
    at net.minecraft.server.EntitySkeleton.v(EntitySkeleton.java:45)
    at net.minecraft.server.EntityLiving.m_(EntityLiving.java:218)
    at net.minecraft.server.EntityMonster.m_(EntityMonster.java:30)
    at net.minecraft.server.World.entityJoinedWorld(World.java:1198)
    at net.minecraft.server.WorldServer.entityJoinedWorld(WorldServer.java:48)
    at net.minecraft.server.World.playerJoinedWorld(World.java:1180)
    at net.minecraft.server.World.cleanUp(World.java:1104)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:447)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)

    plz fix this im running a rpg server and this is just too awesome to get rid of Thx! -gabriel11798

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

    conkerisking

    I tried setting up requirements for arrows and it is still free to use any type of arrow, heres my config.

    requirements:
    lightning: 348
    explosive: 289
    teleport: 352
    torch: 50
    materials:remove-arrows:
    fees:
    options:
    send-balance-on-fee: false
    No errors come up in java.
    Im running the newest bukkit with death notifier, dwarfforge,duels, hookshot,livingbuilding,monstertamer,permissionsbukkit,scubakit, and tesla coil.

    Any help would be appreciated Thanks.
     
  21. Offline

    ayan4m1

    What version of CraftBukkit are you using? What version of MultiArrow?

    I forgot to update the documentation apparently; a few weeks ago "requirements" changed to "materials" and my post here seems to be using the old name. Looking at your config file, the area where it reads "materials:remove-arrows:" looks like the problem. Insert a newline so that it reads:

    Code:
    materials:
    remove-arrows:
    
    Then move the requirements down into "materials" and get rid of "requirements." A proper config file should read:

    Code:
    materials:
        lightning: 348
        explosive: 289
        teleport: 352
        torch: 50
    remove-arrows:
    fees:
    options:
        send-balance-on-fee: false
    
    If that doesn't work, delete the file and edit it after MultiArrow makes a new clean one - you'll notice there should be no more "requirements" section and instead just "materials." I also updated the documentation so it's hopefully less confusing for you and other users - thanks for helping make the docs better.

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

    trixed

    this is what i get whenever a player uses it:

    Code:
    11:49:43 [SEVERE] Could not pass event ENTITY_DAMAGE to MultiArrow
    java.lang.NoSuchFieldError: PROJECTILE
            at com.ayan4m1.multiarrow.MultiArrowEntityListener.onEntityDamage(MultiA
    rrowEntityListener.java:111)
            at org.bukkit.plugin.java.JavaPluginLoader$58.execute(JavaPluginLoader.j
    ava:649)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
    a:58)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
    ava:332)
            at net.minecraft.server.EntityLiving.a(EntityLiving.java:486)
            at net.minecraft.server.Entity.a(Entity.java:635)
            at net.minecraft.server.Entity.move(Entity.java:513)
            at net.minecraft.server.EntityLiving.a(EntityLiving.java:582)
            at net.minecraft.server.EntityLiving.v(EntityLiving.java:704)
            at net.minecraft.server.EntityMonster.v(EntityMonster.java:26)
            at net.minecraft.server.EntityZombie.v(EntityZombie.java:30)
            at net.minecraft.server.EntityPigZombie.v(EntityPigZombie.java:52)
            at net.minecraft.server.EntityLiving.m_(EntityLiving.java:218)
            at net.minecraft.server.EntityMonster.m_(EntityMonster.java:30)
            at net.minecraft.server.EntityPigZombie.m_(EntityPigZombie.java:30)
            at net.minecraft.server.World.entityJoinedWorld(World.java:1198)
            at net.minecraft.server.WorldServer.entityJoinedWorld(WorldServer.java:4
    8)
            at net.minecraft.server.World.playerJoinedWorld(World.java:1180)
            at net.minecraft.server.World.cleanUp(World.java:1104)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:447)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    >
     
  23. Offline

    gabriel11798

    build 1000 because noone can get with build 1060 and im using the latest version of Multiarrows
     
  24. Offline

    Slyvr

    Can you add an option in the config file if we have infinite arrows set up that a player can only have 1 arrow in their inventory. Otherwise, they can take advantage of selling the arrows and getting infinite money
     
  25. Offline

    ayan4m1

    If I had time, I will try to add such an option. I wouldn't implement it that way (as checking every time a player picks up an arrow is less efficient) - I would add the ability to auto-remove any arrows with infinite set to true (so they disappear upon hitting something). For now, I only have sporadic bits of time to maintain the plugin, so it may take some time.
     
  26. Offline

    xShiFTyy

    looks great!!!

    wait is this 1.8 because i cant pull back the arrow to make it go further

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

    dranyam

    I have a question the plugin is super cool but very destructive. I loaded creeper heal Thinking it would repair explosions and fire damage but sadly it does not. It heals tnt explosions and regular fire but not from the arrows. Anyone have any ideas.
     
  28. Offline

    Josh_Gadd

    Plugin still works with build 1337 :D
     
  29. Offline

    tireurroyale

    I was having issues with this running MultiArrow 0.9.8 with bukkit build 1126 on minecraft 1.8.1, getting the error:

    Code:
    [SEVERE] Could not load 'plugins/MultiArrow-0.9.8.jar' in folder 'plugins':
    java.util.zip.ZipException: error in opening zip file
        at java.util.zip.ZipFile.open(Native Method)
        at java.util.zip.ZipFile.<init>(ZipFile.java:131)
        at java.util.jar.JarFile.<init>(JarFile.java:150)
        at java.util.jar.JarFile.<init>(JarFile.java:114)
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:62)
        at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:215)
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:136)
        at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:136)
        at org.bukkit.craftbukkit.CraftServer.<init>(CraftServer.java:112)
        at net.minecraft.server.ServerConfigurationManager.<init>(ServerConfigurationManager.java:52)
        at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:136)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:348)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
    As I kind of imagined, this was just from having META-INF in the package, so I decompiled it, took it out, and packaged it back up again. It seems to be working fine now. If anyone is having this problem, I've thrown my version up for download on my Dropbox at http://dl.dropbox.com/u/24677548/MultiArrow-0.9.8.jar, with the understanding that, of course, there's no guarantee that it'll work for you and that all props go to ayan4m1's awesome hard work on such a cool plugin.

    I don't know if this is just a problem with my setup or a common one, but the lack of forum posts seem to suggest it's on my end. If it turns out I've helped anyone in some way, say thanks by buying ayan4m1 a beer.
     
  30. Offline

    malcolmforde

    i dont really want the plugin on my server but it is a great plugin :)
     
  31. Offline

    shanko

    great plugin but it needs to be updated to work with the current bow
     

Share This Page