Key (Data Type)

Defines which key an active power reacts to — a built-in key or one you define in a data pack.

A Key tells an active power which keybinding to react to. It can be written two ways: a plain String naming the key, or an Object with extra options.

"key": "key.attack"
"key": {
    "key": "key.apoli.primary_active",
    "continuous": true
}

Fields

FieldTypeDefaultDescription
keyStringThe keybinding’s translation key (see below).
continuousBooleanfalseIf false, the power activates once when the key is first pressed. If true, it tries to activate every tick the key is held (still respecting cooldown and conditions).

Built-in keys

You can point at any keybinding the game knows about:

Key stringBound to
key.apoli.primary_activeApoli’s primary active-power key (default: unbound)
key.apoli.secondary_activeApoli’s secondary active-power key (default: unbound)
key.attackattack / left click
key.useuse / right click
key.jumpjump
key.sneaksneak
key.forward, key.left, …movement

Data-driven keybinds

You aren’t limited to the built-in keys — you can register your own keybind from a data pack. It appears in the vanilla Controls menu so players can rebind it, and you reference it from a Key field.

Create the keybind in data/<namespace>/keybinds/<name>.json:

{
    "key": "key.keyboard.g",
    "category": "key.categories.apoli",
    "name": "Dash"
}
FieldTypeDefaultDescription
keyStringThe default physical key, e.g. key.keyboard.g, key.mouse.left.
categoryStringkey.categories.apoliThe Controls-menu group it’s listed under.
nameStringoptionalDisplay name. Falls back to an automatic translation key.

The keybind’s id is its file path data/my_pack/keybinds/dash.json becomes my_pack:dash and its keybinding string is key.<namespace>.<path>. So reference the example above with:

"key": "key.my_pack.dash"

Now an active power keyed to key.my_pack.dash fires when the player presses whatever they’ve bound “Dash” to.

Examples

Trigger once each time Apoli’s secondary active key is pressed:

"key": {
    "key": "key.apoli.secondary_active"
}

Trigger every tick the attack key is held:

"key": {
    "key": "key.attack",
    "continuous": true
}