Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-3072

Add Arrow.setTicksLived, or Arrow.setLifetime

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • None

      Would we consider an API for setting the lifetime of an Arrow projectile?

      This would allow plugins to create shorter-lived arrows without having to change arrowDespawnRate per-world or server-wide.

      For minimal NMS diff I would suggest the somewhat awkward API of settings "ticks lived" directly, rather than specifying a lifetime.

      So if a plugin wanted to make an arrow that would only live 100 ticks, they would need to know the world settings for arrowDespawnRate and subtract 100.

      Alternately, we could modify the Arrow behavior slightly to have a lifetime field that, when set, overrides arrowDespawnRate. Or if we want to prevent plugins from creating long-lived arrows, we use the min(lifetime, arrowDespawnRate).

      In either case it'd be nice to add the lifetime counter to deobfuscation mappings, if possible- this is currently EntityArrow.ax as of 1.11.2

            Unassigned Unassigned
            NathanWolf Nathan Wolf
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: