Checking if arrow shot has a certain name?

Discussion in 'Plugin Development' started by kreashenz, Aug 3, 2013.

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

    kreashenz

    How would I check if the arrow that gets shot has a certain name? I'm trying to make a little plugin for a friend (I might release it on BukkitDev) and I need to check if the name equals something. I know you can't use ItemMeta (or can you?) but I'm thinking Metadata would be the way here, and I'm not sure how to use Metadata. If someone can explain a little about metadata and how to use it, that would be great. Thanks!
     
  2. Offline

    tommycake50

    I don't think arrows contain the data from the arrow item in the players inventory.
    it just get removed and a projectile gets launched.
     
  3. Offline

    Rocoty

    May I suggest cancelling the event and launching the projectile on your own while deleting the item from your inventory? That way you'll have complete control over stuff.
     
    tommycake50 likes this.
  4. Offline

    kreashenz

    Rocoty But I need to check in EntityDamageByEntityEvent to see if it has the name, then deal extra damage. How would I do this? tommycake50
     
  5. Offline

    tommycake50

    Well you could get the arrow and get the shooter and then if the shooter has that type of arrows.
    but then you could just use normal arrows and it would still work.
     
  6. Offline

    kreashenz

    tommycake50 Exactly. That's why I was asking if Metadata would be the answer. Maybe you know how to use metadata, and you can help me with this :)
     
  7. Offline

    tommycake50

    But the metadata wouldn't continue across from the arrows to the entity neither would itemmeta.
     
  8. Offline

    jackwilsdon

    Zen3515 and kreashenz like this.
  9. Offline

    kreashenz

    jackwilsdon That's actually helped a lot, MetaData might actually be as easy as I thought. I've just never used it before. Thanks!
     
Thread Status:
Not open for further replies.

Share This Page