Dropping Projectiles?

Discussion in 'Bukkit Help' started by LegitJava, Sep 20, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    LegitJava

    Hey there,

    I'm trying to figure out how to make a projectile drop instead of breaking upon impact with a block. For example, I'd like the snowball to be able to be thrown but instead of breaking upon hitting a block, I would like it to just drop the item instead. Is this possible to do without editing within the projectile classes themselves? Thanks!
     
  2. Offline

    xxMOxMOxx

    Use a ProjectileImpactEvent and spawn a dropped item at that location
     
  3. Offline

    LegitJava


    Did you mean ProjectileHitEvent? There is no ProjectileImpactEvent event.
     
  4. Offline

    xxMOxMOxx

    Yeah sorry, I was too lazy to confirm the name with the JavaDocs
     
  5. Offline

    LegitJava

    Okay, do you know how I would go about spawning an item where the projectile hits a block?
     
  6. Offline

    xxMOxMOxx


    Code:java
    1. event.getWorld().dropItem(event.getLocation(), new ItemStack(Material.COOKIE, 64);
     
Thread Status:
Not open for further replies.

Share This Page