Tags
Creators
Details
All versions
1.2.0
Release
skLambda 1.2.05 months ago 34
Compatibility
Minecraft: Java Edition
26.1.x
1.21.x
Platforms
Paper
Purpur
Changes
I've decided to keep working on skLambda, so I'm maintaining the project again. Here's 1.2.0.
skLambda 1.2.0
Supports: Paper 1.21.1+ · Skript 2.15+
New expressions
- Scanned:
%objects% scanned with %lambda%is likereduced, but it keeps every running result instead of only the last one. Give it3, 5, 2and an adding lambda and you get3, 8, 10. Addfrom %value%to start from a seed, which comes out first, so3, 5, 2from 100 gives100, 103, 108, 110. Handy for running balances and cumulative totals. - Zipped:
%objects% zipped with %objects% using %lambda%walks two lists side by side and combines each pair with a two-argument lambda.(1, 2, 3)zipped with(10, 20, 30)and an adding lambda gives11, 22, 33. It stops at the shorter list. - Piped:
pipe %object% through %lambdas%runs a value through a chain of one-argument lambdas, left to right, feeding each result into the next one.pipe 5 through {_inc}, {_double}is the same as calling double on the result of inc. Anything in the list that isn't a lambda is skipped. - Page / Window:
page N of %objects% by Scuts a list into chunks of S and hands you the Nth one (1-based). The last page can be shorter, and a page past the end is empty.window N of %objects% by Sslides one element at a time instead, so window 1 is items 1 to S and window 2 is items 2 to S+1. Good for paging a list into a GUI. - Page count / Window count:
page count of %objects% by Sis how many pages the list splits into, rounded up so a partial last page still counts.window count of %objects% by Sislength - S + 1. Loop over the count to fill a menu. - Listener cooldown:
cooldown of %listener%(or%listener%'s cooldown) reads thecooldown:you set on a listener, and you can change it from outside with set, add, and remove. Set it to zero to turn the cooldown off. - Listener owner:
owner of %listener%(or%listener%'s owner) gives back the owner you tied a listener to withowner:, or nothing if it has none.
New conditions
- Counting quantifiers:
at least N of,at most N of, andexactly N of %objects% passescheck how many predicates in a list pass, not just all of them or none.if at least 2 of {requirements::*} passes for {_p}:is true when two or more hold. They sit right next to the existingall of/any of/none offorms.
New effect
- Pause / resume by owner:
pause all listeners owned by %object%freezes every listener tied to that owner in one line, andresume all listeners owned by %object%brings them back. Same idea asunregister all listeners owned by, except it only pauses instead of stopping them for good.
Improvements
- Default parameters: a lambda parameter can carry a default,
lambda (n: number = 1) -> number:. When the caller leaves that argument off, the default fills in. Only trailing arguments can be skipped, socall {_f} with 10on a two-parameter lambda uses the default for the second one. - Options work inside listen entries: script
options:like{@grace}now expand inside alistensection, so you can writecountdown: {@grace}orcooldown: {@debounce}and reuse one value across listeners. They used to be left as raw text and fail to parse.
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle. To learn more about the Modrinth Maven API, click here.
Note: When available, you should use the creator's maven repo instead as it will have transitive dependency information that the Modrinth Maven API does not. You may also end up with duplicate dependencies if you use a mix of Modrinth and non-Modrinth Maven repositories for your dependencies, because the group identifier will be different when served through the Modrinth Maven API.
Maven coordinates:
Version ID:
build.gradle:
repositories {
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
// forRepositories(fg.repository) // Uncomment when using ForgeGradle
filter {
includeGroup "maven.modrinth"
}
}
}
// Standard Gradle dependency
dependencies {
implementation "maven.modrinth:TmcZveKm:S6xPTLg1"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:TmcZveKm:S6xPTLg1"
}

