Is it worth to use nashorn ?

Hello,

I’ve been experimenting with nashorn lately and I have a few questions about it.

Firstly, I wanted to create scripts for events(onUnitDeath, on…) to let the user customize it without having to recompile the game and I’m not sure if it is a good idea to do it this way.

Secondly, is it possible to disable/prevent Java code from being run within JavaScript code ?
I asked this one, because some people can simply call the “java.io.File.delete()” function and other functions like that and because I don’t plan on using it for the client side ?

Thanks in advance for your help.