Custom Event Skript-reflect help

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

Guinzy

Member
Mar 28, 2025
3
0
1
ive checked the docs and everything... but i still cant find out how to make a custom event


event "RightClickSneaking":
pattern: (right click|rightclick) [(while|whilst)] (sneaking|crouching|shifting)
event-values: player
parse:

on right click while sneaking:
#code here


i want something like this but i dont know what to put at the parse section for it to call the code i put in the event whenever someone right clicks while sneaking

dont tell me to check the docs because i already have and it doesnt tell me anything
 
Took me a while to understand but finally got it

Code:
event "RightClickSneaking":
    pattern: (right click|rightclick) [(while|whilst)] (sneaking|crouching|shifting)
    event-values: player, block, direction, entity, world
    parse:
        set {rcs} to event
        continue
        
on right click:
    player is sneaking
    if {rcs} is not set:
        set {_values::player} to event-player
        set {_values::block} to event-block
        set {_values::direction} to event-direction
        set {_values::entity} to event-entity
        set {_values::world} to event-world

        set {_event} to custom event "RightClickSneaking" using event-values {_values::*}
        call event {_event}

        wait 0.0 seconds
        delete {rcs}
        
#So now u can do stuff like
#on right click while shifting:
#    broadcast "%player% just right clicked while shifting!"
 
Took me a while to understand but finally got it

Code:
event "RightClickSneaking":
    pattern: (right click|rightclick) [(while|whilst)] (sneaking|crouching|shifting)
    event-values: player, block, direction, entity, world
    parse:
        set {rcs} to event
        continue
       
on right click:
    player is sneaking
    if {rcs} is not set:
        set {_values::player} to event-player
        set {_values::block} to event-block
        set {_values::direction} to event-direction
        set {_values::entity} to event-entity
        set {_values::world} to event-world

        set {_event} to custom event "RightClickSneaking" using event-values {_values::*}
        call event {_event}

        wait 0.0 seconds
        delete {rcs}
       
#So now u can do stuff like
#on right click while shifting:
#    broadcast "%player% just right clicked while shifting!"
It's probably somewhat scuffed but it works.