Table of Contents

Class JsonPatch

Namespace
Vintagestory.ServerMods.NoObf
Assembly
VSEssentials.dll

Defines a patch for a json asset. This allows modifying json files through mods without directly editing them. To help with creating patches, it is highly recommended to learn how to use the in-built modmaker program. See https://wiki.vintagestory.at/Modding:Inbuilt_ModMaker for more info.

public class JsonPatch
Inheritance
JsonPatch

Fields

File (Required)

The asset location of the file where the patch should be applied.

public AssetLocation File

Field Value

AssetLocation

Op (Required)

The operation for the patch. Essentially controls what the patch actually does.

public EnumJsonPatchOp Op

Field Value

EnumJsonPatchOp

Path (Required)

This is the path to the json property where the operation will take place.

public string Path

Field Value

string

Value (Recommended) (Default: None)

If adding, this is the value (or values) that will be added.

[JsonProperty]
[JsonConverter(typeof(JsonAttributesConverter))]
public JsonObject Value

Field Value

JsonObject

Condition (Optional) (Default: None)

A condition that this patch must satisfy to be applied. Uses specific values from the world config. Useful in conjunction with code mods.

public PatchCondition Condition

Field Value

PatchCondition

DependsOn (Optional) (Default: None)

A list of mod dependencies for the patch. Can be used to create patches that are specific on certain mods being installed. Useful for compatibility!

public PatchModDependence[] DependsOn

Field Value

PatchModDependence[]

Enabled (Optional) (Default: True)

Should this patch be applied or not?

public bool Enabled

Field Value

bool

FromPath (Optional)

If using Move or Copy, this is the path to the json property to move or copy from.

public string FromPath

Field Value

string

Side (Optional) (Default: Universal)

The app side that the patch should be loaded on.

public EnumAppSide? Side

Field Value

EnumAppSide?

Properties

SideType (Obsolete)

The app side that the patch should be loaded on. Obsolete, please use Side instead.

[Obsolete("Use Side instead")]
public EnumAppSide? SideType { get; set; }

Property Value

EnumAppSide?