Pack Making JSON Conditions - DonBruce64/MinecraftTransportSimulator GitHub Wiki

Conditions, as the name suggests, are used to check if a variable(s) meet certain conditions that are defined within it. These are then used, say within a part slot's activeConditions, to say if that part slot is active or not.

Condition Parameters

  • type – The type for this condition. Valid values are as below:

    Value Condition Description
    active input > 0 True if input is greater than 0
    match input == parameter1 True if input is equal to parameter1
    match_var input == variable1 True if input is equal to variable
    greater input > parameter1 True if input is greater than parameter1
    greater_var input > variable1 True if input is greater than variable1
    bounds input > parameter1 and input < parameter2 True if input is greater than parameter1 AND if input is less than parameter2
    bounds_var input > variable1 and input < variable2 True if input is greater than variable1 AND if input is less than variable2
    conditions - True if at least one of the entries in conditons is True
  • input – Input variable. It may be a number prefixed with # to indicate a constant.

  • variable1 – A variable used in these types: match_var, greater_var, bounds_var.

  • variable2 – Like variable1, but only used in these types: bounds_var.

  • parameter1 – A constant value used in these types: match, greater, bounds.

  • variable2 – Like parameter1, but only used in these types: bounds.

  • conditions – Only if type is conditions. A list of conditions to use for this condition.

  • invert – If true, inverts the logic of this condition.