Arrow Despawn Event?

Discussion in 'Plugin Development' started by BarnabyD, May 14, 2013.

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

    BarnabyD

    Hey,

    I'm wondering if there is an Event that is triggered when an arrow despawns (one which was stuck inside a block, or player). The ItemDespawnEvent does not seem to trigger with this type of entity.

    Or if I could extend its tick despawn time somehow, unsure how I could go about doing this. I am spawning the arrow in myself, it is saved, so I can despawn/remove it when I want.

    Any information on the matter would be great, thanks.
     
  2. Offline

    sirrus86

    An arrow's despawn may have to do with how long it's existed, which you can alter:
    Code:
    arrow.setTicksLived(0);
     
  3. Offline

    BarnabyD

    (Note, you cant set it to be less than a tick, so should be 1, not 0)
    But yeah, looked at that before, in order for me to use that, I would have to set up some sort of scheduler to run every minute to set the ticks lived back to 1 for each arrow.

    I could do that, but still interested if there is a way for me to edit the arrows max age, rather then reset each arrow's age.
     
Thread Status:
Not open for further replies.

Share This Page