Plugin category: Fun, Mechanics Suggested name: EntityBow What I want: This plugin request is a little complex, but I know it will be a somewhat popular idea. Basically, when bows have a certain enchantment, they can shoot certain entities from their bow. I don't know much Java, but I know this is very possible with if/else statements. To make this request easier to understand, these are the enchants and what they do. If a bow has... Infinity II: Entity: Enderpearl Effect: Same effect as enderpearl Item: Enderpearl Infinity III: Entity: Snowball Effect: Slowness II for 10 seconds Item: Snowball Infinity IV: Entity: Fire Charge Effect: Sets the place/person it hits on fire with no arrow damage Item: Fire Charge Infinity V: Entity: Egg Effect: Creates an explosion upon impact, with no arrow damage (Although a direct hit will cause the person to get damaged by the explosion) Item: Egg Config: Block damage: true/false Unbreaking X: Effect: Allows the unlimited use of entity bows, as long as they have one item Example: A bow with Infinity IV and Unbreaking X allows you to shoot fire charges as many times as you want, as long as you have one fire charge in your inventory. Ideas for commands: No commands needed for this plugin. Ideas for permissions: ebow.I: Allows the use of the bow with the enchant Infinity II ebow.II: Allows the use of the bow with the enchant Infinity III ebow.IV: Allows the use of the bow with the enchant Infinity IV ebow.V: Allows the use of the bow with the enchant Infinity V ebow.X: Allows the use of the bow with the enchant unbreaking X ebow.*: All permissions If they don't have the permissions, the bows act normally. It would also be great if it was posted on BukkitDev, since I'm sure a lot of people would like it. Bump EDIT by Moderator: merged posts, please use the edit button instead of double posting.
For any devs who might be interested, I think you would have to listen for PlayerInteractEvent, check if the item in hand is a bow, get enchantments, etc. As far as I am aware, there is no event that listens for when they let the arrow shoot from their bow.
Actually, a more simple method would be to use bukkits ProjectileLaunchEvent. Check if the player has a certain enchanted bow in hand and add the velocity of that entity to the same of a arrow when shot from a bow. Then you can check where the entity lands and add a effect to that area.
Code: @EventHandler public void onArrowShoot(EntityShootBowEvent e) { if(e.getEntity() instanceof Player) { Player p = (Player) e.getEntity(); ItemStack item1 = new ItemStack(Material.BOW); if(item1.containsEnchantment(Enchantment.ARROW_INFINITE)) { e.setCancelled(true); EnderPearl pearl = p.launchProjectile(EnderPearl.class); pearl.setShooter(p); } } } With all the logic in the world, this should work. EDIT: Forgot to actually check if player used that bow to shoot, but you get the idea
That's the point, I don't want everyone running around with them, but I do want them to be obtainable through shops. Is it impossible to do this on the development side of things?
I am already using them into my new plugin, for containing custom ids, durability, eat effects, fight effects, ect