Script Eval

A capability registry to enable the use of eval() and Function() from string in Minecraft scripting.

Enable it in manifest.json if neccessary.

manifest.json

{
  "capabilities": ["script_eval"]
}

Usage

You can execute JavaScript code through the Function object or eval function.

new Function('console.log("Hello World")');
eval('console.log("Hello World")');

Check out the following links for more infomation:

Errors

Following errors are thrown if script_eval is not enabled:

  • 'eval is not supported' or ''eval' is not defined'
  • Function from string is not supported
Last Updated:
Contributors: jayly-bot