Disable firework damage?

  • 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 comminuty!

    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.

entwickeln

Member
May 11, 2022
40
0
6
21
Hello guys! Does somebody know how i can disable firework damage?
And do i need an addon for this?
4cfbd267e707002cb36cdef88496c525.png

I want to disable firework damage ONLY when a firework spawns here
 
I haven't tested this but it should work.

Code:
command /test:
    trigger:
        launch ball large coloured red, purple and white fading to light green and black at player's location with duration 1
        set metadata value "cancelDamage" of last spawned firework to true

on damage:
    if damage cause is entity explosion:
        if event-projectile has metadata value "cancelDamage":
            if metadata value "cancelDamage" of event-projectile is true:
                cancel event
 
I haven't tested this but it should work.

Code:
command /test:
    trigger:
        launch ball large coloured red, purple and white fading to light green and black at player's location with duration 1
        set metadata value "cancelDamage" of last spawned firework to true

on damage:
    if damage cause is entity explosion:
        if event-projectile has metadata value "cancelDamage":
            if metadata value "cancelDamage" of event-projectile is true:
                cancel event
It's not working. Im getting damage
[doublepost=1654262932,1654262385][/doublepost]
You could give the firework a nbt tag and check for it in on damage event.
okay i got it, i used this here:


on damage:
if damage cause is entity explosion:
if event-projectile is firework:
cancel event
 
Status
Not open for further replies.