Skip to content

Guides

What are guides?

Guides are a feature of Controlify that shows hints to the player about what buttons to press to perform certain actions.

Since version 2.3.0, guides are data-driven, meaning you can override the default guides with your own.

The in-game button guide

The container button guide

Concepts

There are three main concepts you need to understand to create your own guides.

  1. Fact
    • A fact is a piece of information about the current game state.
    • For example, the fact controlify:on_ground is true when the player is on the ground.
  2. Rule
    • A rule contains a list of permitting facts, and a list of forbidding facts.
    • If all permitting facts are true and no forbidding facts are true, the rule is applied if its binding is bound.
    • For example, a rule for controlify:jump requires the fact controlify:on_ground, then show some text and the button glyph for the jump binding.
  3. Domain
    • A domain contains all loaded facts and rules for a specific type of guide.
    • controlify:in_game is a domain that has in-game specific facts, and rules to show when the player is in-game.
    • controlify:container is a domain that has facts and rules for when the player is in a container GUI, like the inventory or a chest.
    • For example, you wouldn't have a rule for controlify:on_ground in the controlify:container domain, since it's irrelevant in a container GUI.

Creating custom rules

Controlify only allows resource packs to add and override rules, not facts or domains.

If Controlify does not have a fact for your specific use case, you must create a mod that adds the fact to Controlify, or submit a feature request to get it added to Controlify itself.

json
{
    "override": false,
    "rules": [
        {
            "for": "controlify:jump",
            "where": "left",
            "when": ["controlify:on_ground"],
            "forbid": [],
            "then": "Jump"
        }
    ]
}

This example shows a rule that applies when the player is on the ground, and the controlify:jump binding is bound. When the rule applies, it shows the text "Jump" and the glyph for the controlify:jump binding.

As well as literal text such as "Jump", Controlify supports the Minecraft text component format which allows you to use translations and styling. For example, you can use "then": {"translate": "mypack.jump"} to use a translation key sourced from your pack's language files.

A rule can be displayed either on the left or right side of the screen, this is defined by the "where" field.

Because "override": false, this resource pack will not override the default rules, but instead add an additional rule. If you want to override the default rules, or any resource pack below yours, set "override": true.

Stacking rules

You can stack multiple rules for the same binding, the first rule that succeeds will be applied, the rest will be ignored. However, if the rules have different locations (e.g. left and right), they will both be applied.

json
{
    "override": false,
    "rules": [
        {
            "for": "controlify:jump",
            "where": "left",
            "when": ["controlify:in_water"],
            "forbid": [],
            "then": "Swim Up"
        },
        {
            "for": "controlify:jump",
            "where": "left",
            "when": ["controlify:on_ground"],
            "forbid": [],
            "then": "Jump"
        }
    ]
}

In this snippet, the first rule will apply when the player is in water, and the second rule will apply when the player is on the ground.

Even when the player is in water and touching the ground, only the first rule will apply, because it is the first rule that matches its conditions.

Facts

Controlify has a set of built-in facts that you can use in your rules.

Below is a list of the built-in facts for each domain.

Common facts

These facts are available in all domains.

IDDescription
controlify:verbosity_fullWhen the guide verbosity level is set to full.
controlify:verbosity_reduced_or_moreWhen the guide verbosity level is either full or reduced.
controlify:verbosity_reduced_or_lessWhen the guide verbosity is set to reduced or less.
controlify:verbosity_minimalWhen the guide verbosity is set to minimal.

controlify:in_game

IDDescription
controlify:on_groundWhen the player is on the ground.
controlify:in_vehicleWhen the player is in a vehicle.
controlify:riding_saddled_horseWhen the currently ridden vehicle is a horse with a saddle.
controlify:riding_happy_ghastWhen the currently ridden vehicle is a Happy Ghast.
controlify:flyingWhen the player is currently in creative flight.
controlify:elytra_flyingWhen the player is currently gliding with an elytra.
controlify:can_elytra_flyWhen the player is in a state where pressing jump will cause the elytra to deploy.
controlify:in_liquidWhen the player is touching liquid, such as water or lava.
controlify:in_waterWhen the player is touching water.
controlify:under_waterWhen the player has their eyes underwater.
controlify:in_lavaWhen the player is touching lava.
controlify:sneakingWhen the player is attempting to sneak (pressing the sneak key, or it is toggled on).
controlify:is_toggle_sneakWhen the player is using toggle sneak (does not mean it is currently toggled on).
controlify:is_toggle_sprintWhen the player is using toggle sprint (does not mean it is currently toggled on).
controlify:sprintingWhen the player is attempting to sprint (pressing the sprint key, or it is toggled on).
controlify:input_movingWhen the player is applying movement input—even if the player is not physically moving, if they're trying to, this fact goes.
controlify:is_spectatorWhen the player is in spectator mode.
controlify:is_creativeWhen the player is in creative mode.
controlify:has_heartsWhen the player is not invulnerable.
controlify:is_adventureWhen the player is in adventure mode.
controlify:is_survivalWhen the player is in survival mode.
controlify:looking_at_entityWhen the player is currently looking at an entity and is in range to interact with it.
controlify:looking_at_blockWhen the player is currently looking at a block and is in range to interact or destroy it.
controlify:looking_at_airWhen the player is neither looking at a block nor looking at an entity.
controlify:has_item_in_either_handWhen the player has an item in their main hand or their offhand.
controlify:has_item_in_mainhandWhen the player has an item in their main hand.
controlify:has_item_in_offhandWhen the player has an item in their offhand.
controlify:has_multiple_items_in_handWhen the player is holding an item stack with a count greater than one.

controlify:container

IDDescription
controlify:hovering_slotWhen the user is hovering their cursor over a slot.
controlify:hovering_itemWhen the user is hovering their cursor over an occupied slot.
controlify:hovering_many_itemsWhen the user is hovering their cursor over an occupied slot which has more than one item in it.
controlify:holding_itemWhen the user has grabbed an item and is moving it around with their cursor.
controlify:holding_many_itemsWhen the user has grabbed an item and is moving it around with their cursor, and that item has more than one in the stack.
controlify:can_place_held_itemWhen the container allows the player to place down their held item into the currently hovered slot.
controlify:cursor_outside_containerWhen the user is hovering their cursor outside the container interface.
controlify:hovering_item_is_bundleWhen the user is hovering their cursor over a slot which is occupied with an item tagged as a bundle.
controlify:selected_bundle_slotWhen the user is currently selecting an item from within the bundle they're hovering.

Controlify is an open-source Minecraft mod.