Pack Making JSON ValueModifiers - DonBruce64/MinecraftTransportSimulator GitHub Wiki

Value modifiers perform arithmetic or math and returns an output value. Used for if you need to increase sound volume or pitch using variables and other values.

Value Modifier Parameters

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

    Value Logic
    set output = input
    add output = value + input
    subtract output = value - input
    multiply output = value * input
    divide output = value / input
    linear output = input * parameter1 + paramter2 Graph Calculator
    parabolic output = parameter1 * (input * parameter2 - parameter3)^2 + parameter4 Graph Calculator
    conditions if all conditions are true then trueCode, else falseCode
  • input – Input variable. It may be a number prefixed with # to indicate a constant.

  • parameter1 – A constant value used in these types: linear, parabolic.

  • parameter2 – A constant value used in these types: linear, parabolic.

  • parameter3 – A constant value used in these types: parabolic.

  • parameter4 – A constant value used in these types: parabolic.

  • conditions – Only if type is conditions. A list of conditions to use for this valueModifier. Runs trueCode if all conditions are true, else falseCode

  • trueCode – A list of value modifiers to run if conditions is true.

  • falseCode – A list of value modifiers to run if condtions is false