FANDOM


Introduction Edit

Hello novice coders! I'm Ray and I'm here to hopefully make coding with Xie's Mod a bit easier. First off, let's start with the JSON syntax!

Syntax Edit

JSON is a simple coding that Xie's Mod utilizes to make changes to Minecraft, let's go over what it can do. We will start this by looking at an example of the syntax:

{
  "blocks": {
    "exampleBlock": {
      "name": "Example",
      "id": "256",
      "type": "default",
      "lightLevel": 0.4,
      "walkthroughable": "false"
    }
  }
}

This is a basic block code (and a rather incomplete one as well), but it's just an example, so let's break it down.

First off, braces are what make up the "levels" of code. Think of it as a study outline you made for school (you know, roman numerals for main ideas, then letters for details, then normal numbers, etc. etc.). This is essentially the same thing, except with braces and the symbols don't differe between levels. A forward brace "{" designates a new level of code, while a backward brace "}" designates closing of a level of code.

Now let's look at the strings we have. There are a few different types, let's just start with a basic opening string. "blocks" is a category, with the four current categories in Xie's Mod are "blocks", "items", "recipes", and "spawns". These will occupy the first level of every Xie code. next, there's the identifier: "exampleBlock". This identifies the "code name" of the block, item, recipe, or spawn, but in recipes and spawns it doesn't matter as much. These can be used in other parts of code instead of an ID (in the case of blocks and items). Next comes the defining strings: "name", "id", "type", etc. These strings define the block, item, etc. These three strings all have one major thing in common, they all have a colon ":" after them. The point of this is to describe the string. let's look at the strings that come after the colon ":" now. For "name", the string is essentially the same as other strings, just letters. For "id", it's also the same, except the fact that it's numbers. "default" in "type" is a category (which means that only select strings can be used, unlike "Example" in which you can put almost anything). Here's where things get a bit confusing. 0.4 in "lightLevel" is a float, which means it doesn't require quotes " around it. Floats are always numbers, and are typically between 0 and 1. These are usually used for percentiles. Finally there are booleans, which is essentially just true or false.

A few little pointers for making code,

  1. For any part of code that is not the last in the level, put a comma "," after it, as shown in the example (this applies to ends of levels too "}")
  2. If a comma is used within code, there are no spaces (except in the exception of shaped recipes)
  3. Do not touch the tab button
  4. Do NOT touch the tab button

Now that we have syntax down, let's move on.

Extinct Edit

Tutorial is discontinued, sorry ~Ray

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.