Skip to content

JSON Files

urstruktur edited this page Nov 30, 2016 · 10 revisions

Crafting

Example of crafting json file defining the crafting receipts. Meant to be modified manually.

{
	"receipts": [{
		"ingredients": {
			"1": {
				"typeID": "woodblock",
				"pos": [0, 0],
				"amount": 1
			},
			"2": {
				"typeID": "stoneblock",
				"pos": [1, 0],
				"amount": 1
			}
		},
		"resultTypeID": "lasergun"
	}, {
		"ingredients": {
			"1": {
				"typeID": "woodblock",
				"pos": [0, 0],
				"amount": 1
			},
			"2": {
				"typeID": "woodblock",
				"pos": [0, 1],
				"amount": 1
			}
		},
		"resultTypeID": "woodplank"
	}]
}

Item Types

Example of the json file defining all the item types. It defines all available item types and holds all static information like the maximum stack height or image file. Meant to be modified manually.

{
	"itemtypes" : {
		"stoneblock" : {
			"category": "block",
			"name": "Stone Block",
			"maxStackHeight": 64,
			"hasWear": false,
			"image": "items/stoneblock.png"
		},

		"woodblock" : {
			"name": "Wood Block",
			"category": "block",
			"maxStackHeight": 64,
			"hasWear": false,
			"image": "items/woodblock.png"
		},

		"lasergun" : {
			"name": "Laser Gun",
			"category": "tool",
			"maxStackHeight": 1,
			"hasWear": true,
			"image": "items/lasergun.png"
		}
	}
}

Inventory

The json representation of a players inventory. Only meant to be created programmatically for saving and loading.

{
	"inventory": {
		"items": [
			{
			"pos": [1, 2],
			"typeID": "woodblock",
			"stackHeight": 3
			}, 
			{
			"pos": [0, 3],
			"typeID": "lasergun",
			"wear": 1.0
			}
		]
	}
}

ALL VALID!

Clone this wiki locally