Explosive bow

Discussion in 'Spigot Plugin Development' started by NaJated, Jun 14, 2015.

  1. Hey all, how would I go about getting where an arrow lands and then exploding blocks only if the block is in a region then returning the blocks you broke to their inventory taking fortune blocks into account etc
     
  2. Use the ProjectileHitEvent and check if the entity (projectile) is an Arrow. If so, create an explosion. If you want to add the blocks to the player's inventory, create a BlockExplodeEvent (I believe), add all those blocks to an ArrayList and add them to the inventory of the person who shot the arrow.
     
  3. but i need to register it as a block break event so the player's fortune actually works.
     
  4. Inkzzz

    Resource Staff

    Store a players fortune to a YML file perhaps?
    Alternatively you could have fortune bows?
     
    • Agree Agree x 1
  5. It would just be easier to do it as a block break since the blocks broken : blocks received ratio will probably be different if I didn't use the current system i'm using now (another plugin that modifies fortune)
     
  6. You just need to be careful with NoCheatPlus kicking a players ;) BTDT.
     
  7. Also check to make sure that the arrow was shot by a player, and that the player has the bow, and that the bow that fired the arrow was the one that is explosive.