| title | Script Eval |
|---|---|
| description | A capability registry to enable the use of eval() and Function() from string in Minecraft scripting. |
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"]
}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:
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