Skip to content

6. Spell Trees JSON Formats

CAS_ual_TY edited this page Oct 9, 2023 · 5 revisions

Spell Trees JSON Formats

WIP


Spell Tree

WIP

JSON Format:

{
  "s1/title": Component,
  "s2/icon": Spell Icon,
  "s3/root_node": Spell Node
}

Elements:

  • s1/title: The name of the spell tree.
  • s2/icon: The icon used for the tab of this spell tree (see Spells Format).
  • s3/root_node: The root spell of this tree.

Spell Node

JSON Format:

{
  "n1/spell_id": String,
  "n2/node_id": Optional Integer,
  "n3/node_frame": Optional Integer,
  "n4/level_cost": Integer,
  "n5/hidden_requirements": [
    Optional Requirements...
  ],
  "n6/learn_requirements": [
    Optional Requirements...
  ],
  "n7/mana_cost": Optional Double,
  "n8/spell_parameters": [
    Optional Variables...
  ],
  "n9/child_nodes": [
    Spell Nodes...
  ]
}

Elements:

  • n1/spell_id: The id of the spell this node unlocks when learning it.
  • n2/node_id (Optional): A unique integer within this spell tree to identify this spell node. The value must be between 1 and 4294967295 (both inclusive). This is optional and can be left out entirely.
  • n3/node_frame (Optional): The background frame used in the spell tree, eg. 0 = advancement, 1 = challenge, 2 = goal (see the frames here: https://minecraft.fandom.com/wiki/Advancement). This is optional and can be left out entirely (default is 0).
  • n4/level_cost: The amount of xp levels this spell costs to learn.
  • n5/hidden_requirements (Optional): All requirements you must fulfill to be able to see this spell in the spell tree and to be able to learn it. This is optional and can be left out entirely.
  • n6/learn_requirements (Optional): All requirements you must fulfill to be able to learn this spell. This is optional and can be left out entirely.
  • n7/mana_cost (Optional): The spell's mana cost can be overridden by setting this field to a value greater than or equal 0. This is optional and can be left out entirely.
  • n8/spell_parameters (Optional): The spell's parameters can be overridden by setting the same ones (same name and type) here with different values. This is optional and can be left out entirely.
  • n9/child_nodes: Children nodes of this node in the tree.

Variable

WIP See Spells JSON Formats


Requirement

All types of requirements for spell nodes in spell trees usable for both hidden requirements and learn requirements.


bookshelves Type

JSON Format:

{
  "type": "spells_and_shields:bookshelves",
  "bookshelves": Integer
}

Elements:

  • bookshelves:

advancement Type

JSON Format:

{
  "type": "spells_and_shields:advancement",
  "advancement": "minecraft:end/root"
}

Elements:

  • advancement:

item Type

JSON Format:

{
  "type": "spells_and_shields:item",
  "item": Item,
  "consume": Boolean
}

Elements:

  • item: The item you have to carry in your inventory in order to be able to learn this spell
  • consume: Whether or not to consume to item when the spell is learned

wrapped Type

In case you have seen this somehow this needs to be mentioned: Do not use this! This type is only used for synchronization from the server to the client and if you use this the game will crash.

Clone this wiki locally