Tags
Creators
Details
All versions
1.1.0
Release
skLambda 1.1.05 months ago 11
Compatibility
Minecraft: Java Edition
26.1.x
1.21.x
Platforms
Paper
Purpur
Changes
skLambda 1.1.0
Supports: Paper 1.21.1+ · Skript 2.15+
New expressions
- Highest / Lowest By:
highest of %objects% by %lambda%andlowest of %objects% by %lambda%give you back the one item with the biggest or smallest value. You write a small lambda that scores each item, and it hands you the winning item itself. Ties keep the first one; an empty list gives nothing. You can also sayminormax. - Bound:
%lambda% with %objects% boundfills in the first argument(s) ahead of time. An "add two numbers" lambda can become "add 5 to whatever you give me." Fill in every argument and you get a lambda that takes nothing and just returns the answer. - Negated:
negated %lambda%(ornegation of %lambda%) flips a yes/no check so it passes when the original would fail. Handy withfiltered whereandcount of … where. - Active Listeners:
all active listenersgives you every listener running right now (the same ones/sklambda listenersshows).listeners owned by %object%gives you just the ones tied to one owner. You can loop over them and shut them down.
New listener options
- on register:: runs once, right when the listener starts up. It's the partner to
on end:, so you can set things up and clean them up in one place.
Improvements
- One-line lambdas can return a value: before, a one-line lambda could only check something or do something. Now it can also give back a value,
lambda (a, b): return {_a} + {_b}, or even shorter,lambda (n): {_n} * 2. - Lambdas remember nearby variables: a lambda keeps a copy of the local variables (
{_x}) from where you wrote it, so it can still read them when it runs later. It's a snapshot from that moment, changing those variables afterward won't affect it, and changes inside won't leak out. If a parameter shares a name with one of them, the parameter wins. - Reduce with a starting value:
%objects% reduced with %lambda% from %object%lets you set what the total starts at. An empty list just gives back the starting value, and the start can be a different type than the items (like joining a list of items into one piece of text). - More owner types:
owner:used to really only work for players. Now an entity, chunk, or world can own a listener too. It cleans itself up automatically when the owner goes away, a player logging off, an entity dying or despawning, or a chunk/world unloading. (Teleporting between worlds no longer wrongly kills a player's listeners.) - Use lambdas from Java: developers can turn a Skript lambda straight into a normal Java function with
asPredicate(),asFunction(),asBiFunction(),asConsumer(), andasSupplier().
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:yG21gVT1"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:TmcZveKm:yG21gVT1"
}

