Codeprogrammers/codecraft-init-script — comment on commit 1b078d3abf71c1117cc946378832a863797efe6f
File:  line 0
By Toasty27:

If I remember correctly, you can't run that through the 'as_user' function because doing so loses the directory context. Whenever running something through the 'as_user' function, it defaults to the user's (in this case minecraft's) home directory. So now you're only copying directories in minecraft's home directory into the ramdisk.

I could be wrong, but I'm pretty sure the 'as_user' function works like that because I had problems in the past where I'd run a cd command through the as_user function, and the script wouldn't stay in that same directory unless you ran your other commands inside of the same instance of the 'as_user' function.