# Welcome

If you are here looking for Resourceful Bees documentation you are in the wrong location.

But if you are here for Resourceful Lib highlight documentation head the the location below!


# Highlights

Highlights are a custom way to create more complex visual selection boxes, this is a client only operation and does not actually affect where the player can hit so it is important that the block is still within a normal hit box.

Currently there are 2 ways to bind a highlight to a block, through code using the <mark style="color:orange;">`Highlightable`</mark> interface on your block or using the json API which can also be used by non mod authors to change a hit box depending on a new model for a block.

Highlights are a client asset so they are stored in your assets folder under the namespace <mark style="color:blue;">`resourcefullib/highlights`</mark>

Highlight jsons are either a highlight itself for a highlight state, just like how a block has a blockstate json and a model json.

To read more click one of the options below.

{% content-ref url="/pages/84n3PPrXxHOtBnIm7CZN" %}
[Highlight](/welcome/highlights/highlight)
{% endcontent-ref %}

{% content-ref url="/pages/vcms91cYpoSrq6NqyCdm" %}
[Highlight State](/welcome/highlights/highlight-state)
{% endcontent-ref %}


# Highlight

Highlights are a simple json they only contain one thing a list of <mark style="color:red;">`line`</mark>&#x20;

A line is an array of 6 floats with the first 3 being for the first point and the second 3 being for the second point in the line.

Line floats are not Minecraft pixels so if you want a Minecraft pixel position divide it by 16 to get the value for the line.

{% tabs %}
{% tab title="Example" %}
This example is to have a single line from the bottom left back corner going to the top right front corner.

{% code title="corner\_line.json" lineNumbers="true" %}

```json
{
    "lines": [
        [0, 0, 0, 1, 1, 1]
    ]
}
```

{% endcode %}
{% endtab %}
{% endtabs %}


# Highlight State

Highlight states are pretty similar to blockstates and are formatted in a similar manner for the json.

For highlight states we have a single object of <mark style="color:red;">`variants`</mark> which has key pair values with the key being the state of the block just like how you would format a blockstate and then the value either being a reference string to the highlight or an object formatted like such.

{% hint style="danger" %}
**Note:** Highlight states MUST be located in the same namespace as the namespace of the block it is being created for.

So for example for <mark style="color:red;">`minecraft:lectern`</mark> it must be located in <mark style="color:blue;">`assets/minecraft/resourcefullib/highlights/lectern.json`</mark> It can reference other namespace objects but must be in the same namespace as the namespace of the id.
{% endhint %}

{% tabs %}
{% tab title="Example" %}
This example uses the corner\_line highlight we created in the highlight section and creates 4 variants 2 where its a direct reference and 2 where it is a sub reference where on west and east it rotates the highlight by 90°.

{% code title="lectern.json" lineNumbers="true" %}

```json
{
    "variants": {
        "facing=south": "minecraft:corner_line",
        "facing=north": "minecraft:corner_line",
        "facing=west": {
            "highlight": "minecraft:corner_line",
            "rotation": { "y": 90 }
        },
        "facing=east": {
            "highlight": "minecraft:corner_line",
            "rotation": { "y": 90 }
        }
    }
}
```

{% endcode %}
{% endtab %}
{% endtabs %}


# Sub-reference Highlight

## Data Object

### Highlight / <mark style="color:red;">`highlight`</mark> / Resource Location

Highlight is the reference to the highlight you would like to make a sub reference to.

It is formatted like such <mark style="color:purple;">`minecraft:corner_line`</mark> to lead to a highlight json of `corner_line` in the `minecraft` namespace.

### Rotation / <mark style="color:red;">`rotation`</mark> / [Rotation](/welcome/highlights/highlight-state/sub-reference-highlight/rotation-object)

Rotation refers to the rotation of the sub reference.

### Translation / <mark style="color:red;">`translation`</mark> / Float\[3]

Translation is a 3 float array with the 3 floats corrosponding respectively to `x, y, z`&#x20;

So if I would like my highlight to be moved up by one I would set translation to <mark style="color:blue;">`[0, 1, 0]`</mark>


# Rotation Object

## Data Object

### X / <mark style="color:red;">`x`</mark> / Int

This is exactly like blockstate rotation where you can only rotate by 90°

### Y / <mark style="color:red;">`y`</mark> / Y

This is exactly like blockstate rotation where you can only rotate by 90°


# Resource Pack

Resourceful Lib provides a builtin resource pack loader via the `mods.toml` and `fabric.mod.json`, this is very useful for lowcode mods which would like to allow for mods to have optional resource packs without using code.\
\
To start you just put your resource pack into a `resourcepacks` folder in the `resources` folder of your mods source, the name you give the resource pack in there is the name you will use in your `mods.toml` or `fabric.mod.json`

#### Example

{% tabs %}
{% tab title="mods.toml" %}

```toml
[modproperties.modid]
'resourcefullib:resourcepack' = [
    { name="resource_pack_folder_name", description="Display Name" }
]
```

{% endtab %}

{% tab title="fabric.mod.json" %}

```json
"custom": {
    "resourcefullib:resourcepack": [
        {
            "name": "resource_pack_folder_name",
            "description": "Display Name"
        }
    ]
}
```

{% endtab %}
{% endtabs %}


