Shooting an item the same way as a dispenser would

Discussion in 'Plugin Development' started by SoThatsIt, May 7, 2013.

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

    SoThatsIt

    im making a plugin that shoots items put in a chest from a minecart and would like to have the minecart shoot the items in the chest like a dispenser would. so it would shoot arrows and snowballs but just drop the item if its not shootable. I already have the inventory of the chest just need to shoot items like a dispenser.
     
  2. Offline

    Nitnelave

    Well, you have to chose a random item from the chest, and then, if it is an arrow or snowball, shoot it, if it's water/lava, place it, and if it is an item, drop it... Nothing magic, nothing hard here.
     
  3. Offline

    InflamedSebi

    if u want to know if it is shootable do an instance check:
    if(item instanceof Projectile){
    // shoot it
    } else {
    // drop it
    }
     
Thread Status:
Not open for further replies.

Share This Page