Detecting Arrow About to Be Shot

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Bjwpokemon

Member
Sep 11, 2020
2
0
0
Is it possible to get the data or custom tag value of the arrow about to be shot. In the process of making custom arrows and I want to be able to distinguish between whether or not a custom arrow is being shot or whether or not a normal arrow is.

Current Code:
Code:
on shoot:
    set {FireArrowCount::%shooter%} to 0
    loop all items in the inventory of shooter:
        if "custom" tag of nbt of loop-item is 91:
            set {FireArrowCount::%shooter%} to item amount of loop-item
    if {FireArrowCount::%shooter%} is more than 0:
        set metadata value "tagName" of projectile to 91
        set {FireArrowActive::%shooter%} to 1
        while {FireArrowActive::%shooter%} is 1:
            wait 1 tick
            show mobspawner flames on projectile

on damage:
    if projectile exists:
        if projectile is arrow:
            if metadata value "tagName" of projectile is 91:
                loop all items in the inventory of shooter:
                    if "custom" tag of nbt of loop-item is 91:
                        set {FireArrowTemp::%shooter%} to item amount of loop-item
                        if {FireArrowTemp::%shooter%} is the same as {FireArrowCount::%shooter%}:
                            remove 1 arrow from loop-item
                            give 1 arrow to shooter
                set {FireArrowActive::%shooter%} to 0
                ignite victim for 5 seconds

on projectile hit:
    if projectile is arrow:
        if metadata value "tagName" of projectile is 91:
            set {FireArrowTemp::%shooter%} to 0
            loop all items in the inventory of shooter:
                if "custom" tag of nbt of loop-item is 91:
                    set {FireArrowTemp::%shooter%} to item amount of loop-item
                    if {FireArrowTemp::%shooter%} is the same as {FireArrowCount::%shooter%}:
                        remove 1 arrow from loop-item
                        give 1 arrow to shooter
            set {FireArrowActive::%shooter%} to 0
            set {FireArrowBlock::%shooter%} to block 1 in front projectile
            add 1 to {FireArrowBlock::%shooter%}'s y-coordinate
            if block at {FireArrowBlock::%shooter%} is air:
                set block at {FireArrowBlock::%shooter%} to fire
 
Status
Not open for further replies.