Mod Creation/Essentials: Difference between revisions

Line 204: Line 204:


Use <syntaxhighlight lang="js" inline>ctx.loadData</syntaxhighlight> to read and automatically parse a JSON resource.
Use <syntaxhighlight lang="js" inline>ctx.loadData</syntaxhighlight> to read and automatically parse a JSON resource.
''Comments in JSON are purely illustrative and not valid markup''


  <syntaxhighlight lang="js" line>// my-data.json
  <syntaxhighlight lang="js" line>// my-data.json
Line 213: Line 211:
   ]
   ]
}</syntaxhighlight>
}</syntaxhighlight>
<small>''Comments in JSON are purely illustrative and not valid markup''</small>


  <syntaxhighlight lang="js" line>// setup.mjs
  <syntaxhighlight lang="js" line>// setup.mjs
91

edits