Skip to content

mapnumber

Daedalus1400 edited this page May 20, 2017 · 1 revision

Description:

The map generic scales an input to a different range. It can clamp the output within the specified range.

Added in release version 0.5.0

Arguments:

type

Must be "map".

input

Accepts a string. Valid values are:

  1. playerposx
  2. playerposy
  3. playerposz
  4. timeofday
  5. worldtime
  6. timesincesleep

"timeofday" is specified in ticks. "worldtime" and "timesincesleep" are specified in in-game days.

inlow

Accepts a number. When the input's value == inlow, output = outlow. Default is 0.

inhigh

Accepts a number. When the input's value == inhigh, output = outhigh.

outlow

Accepts a number. When the input's value == inlow, output = outlow. Default is 0.

outhigh

Accepts a number. When the input's value == inhigh, output = outhigh.

clamp

Accepts a string. When given "true", the output value will never go outside the bounds set by "outlow" and "outhigh", regardless of the input value.

Example Usage:

The following example increases the probability of receiving a nausea effect as the player gets closer to bedrock:

{"type": "potioneffect", "effect": "nausea", "duration": 100, "chance": {"type": "map", "input": "playerposy", "inhigh": 256, "outlow": 5, "outhigh": 100}}
Clone this wiki locally