Skript icon indicating copy to clipboard operation
Skript copied to clipboard

Call on shoot when using EffShoot

Open TheLimeGlass opened this issue 3 years ago • 6 comments

Suggestion

When a Skripter uses the EffShoot effect, it should call the on shoot event.

TheLimeGlass avatar Jul 26 '22 10:07 TheLimeGlass

It already does that

on right click:
    make player shoot arrow

on shoot:
    broadcast "SHOT"

image

UnderscoreTud avatar Jul 26 '22 13:07 UnderscoreTud

Could not replicate when I attempted it. As in no calling of the event.

TheLimeGlass avatar Jul 26 '22 18:07 TheLimeGlass

It actually exists image

see https://github.com/SkriptLang/Skript/blob/e9d04e7604c13d0de8d210f88ea0f021cdace009/src/main/java/ch/njol/skript/effects/EffShoot.java#L99 and ProjectileLaunchEvent extends EntitySpawnEvent see https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/ProjectileLaunchEvent.html

AyhamAl-Ali avatar Jul 26 '22 18:07 AyhamAl-Ali

Try it without an arrow. Try a custom entity. Like a pig which is the original issue someone reported.

It's a ProjectileSource so that shouldn't differ from a defined Projectile in terms of it being involved in the event.

TheLimeGlass avatar Jul 26 '22 18:07 TheLimeGlass

Ah yea, that doesn't trigger the shoot event indeed.

Support should be added here https://github.com/SkriptLang/Skript/blob/e9d04e7604c13d0de8d210f88ea0f021cdace009/src/main/java/ch/njol/skript/effects/EffShoot.java#L109-L115

The issue description should have more info, use this comment as a reference if you like

AyhamAl-Ali avatar Jul 26 '22 18:07 AyhamAl-Ali

I don't think this should be added: on shoot, or ProjectileLaunchEvent only accepts projectiles [1] (technically the constructor doesn't, but getEntity does which will cause issues if we call this event). The name of the Bukkit event also gives it away.

TPGamesNL avatar Jul 27 '22 09:07 TPGamesNL