with

fun <T> with(scope: ModelScope, block: () -> T): T

Sets scope as the active scope for the duration of block, then restores the previous scope (typically global). All entity constructions and registry queries inside block target scope.

Generated with STIG