- Supported Skript Version
- 2.15
- Supported Minecraft Versions
- 1.21
- 26.1
skLambda
A Skript addon that adds two things:
- Lambdas — small functions you can save in a variable and run later.
- The listen section — a short way to make a temporary event listener with a timer, a hit count, and what to do at the end.
Example: same task, two ways
The task: tell the player to mine 10 stone in 30 seconds. Give a diamond if they finish. Say "too slow" if they don't.
Without skLambda
Code:
on break of stone:
if {challenge::%player%} is not set:
stop
add 1 to {challenge::progress::%player%}
send "keep going..." to player
if {challenge::progress::%player%} >= 10:
send "you did it!" to player
give 1 diamond to player
delete {challenge::%player%}
delete {challenge::progress::%player%}
command /challenge:
trigger:
set {challenge::%player%} to true
set {challenge::progress::%player%} to 0
send "mine 10 stone in 30s" to player
wait 30 seconds
if {challenge::%player%} is set:
send "too slow" to player
delete {challenge::%player%}
delete {challenge::progress::%player%}
This works, but you have to do a lot by hand:
- A global on break of stone that runs for every player on the server.
- A flag variable to know which player is in the challenge.
- A counter variable.
- A separate wait 30 seconds to handle the timeout.
- Lots of delete lines to clean up.
With skLambda
Code:
command /challenge:
trigger:
send "mine 10 stone in 30s" to player
listen for block break where event-block is stone:
countdown: 30 seconds
triggers: 10
on trigger:
send "keep going... (%remaining triggers% left)" to event-player
on completion:
send "you did it!" to event-player
give 1 diamond to event-player
on timeout:
send "too slow!" to event-player
That's it. The listener belongs to this one command run. The counter and the timer are built in. When it finishes or times out, it cleans up by itself.
Links


License
MIT
Notes
If you experience any problems, let me know on Discord — eult, or join the Discord server.