Get original itemstack of launched projectile

Discussion in 'Plugin Development' started by 4thegame3, Sep 15, 2014.

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

    4thegame3

    How can i get the original itemstack value from a launched potion for example?
    i need to get also the itemmeta.
     
  2. Offline

    fireblast709

    4thegame3 on PlayerInteractEvent, iterate over the inventory and get the first arrow/snowball/whatever projectile stack if the Action is RIGHT_CLICK_*.

    On ProjectileShootEvent, get that ItemStack and save it as the Projectile's Metadata.

    On EntityDamageByEntity/ProjectileHitEvent, simply get the Metadata and do whatever with the ItemStack. Moreover, remove the Metadata on ProjectileHitEvent (for cleanup)
     
  3. Offline

    4thegame3

    fireblast709
    what is the method in this case to get the itemstack

    EDIT: wait, do i have to use all 3 methods?
     
  4. Offline

    fireblast709

  5. Offline

    4thegame3

  6. Offline

    fireblast709

    4thegame3 It's one 'method' to tackle the issue at hand. I didn't mean 'java method' :p. You would have to listen to all events listed above (whether you listen to the damage, launch or both depends on your code)
     
Thread Status:
Not open for further replies.

Share This Page