Well, I meant a little differently, but thanks for the answer!
I'll tell you a little bit about what exactly I want to do:
I conditionally have a script that uses game code:
val v = Vector3d.ZERO
println(v)
In the development environment it runs and compiles correctly, and at normal startup the code should be:
val v = Vector3d.field_186680_a
println(v)
Accordingly, there are two ways to obfuscate this script. The first is to first compile it using the deobfuscated dependency and then obfuscate Class, as Gradle does during "reobfJar". The second way, which I have already implemented, is to first obfuscate the code, and then compile and run the script itself in the game environment. But for obfuscation in second case I need to get deobfuscated version of Forge/Minecraft, so my idea is to copy Forge into a separate folder during first run and decompile it there, like during environment setup and then just point it into classpath, so Kotlin PSI could analyze the script properly (without dependency it doesn't see any mc fields and functions)