Skip to content

Scarf NBT

Falkreon edited this page Aug 24, 2022 · 1 revision

Scarf NBT

Scarves aren't just customizeable, they are extremely, fully customizeable. The mod will honor any NBT it finds on oddball items and should even gracefully degrade if there is missing or indecipherable data. If you find NBT that crashes Scarves, make an Issue, I will fix it.

Example FabricSquare NBT

"FabricSquare": {
    "Id": "minecraft:block/lime_wool",
    "X":  4,
    "Y":  4,
    "Color": -1, //0xFF_FFFFFF a.k.a. white
    "Emissive": false
}

(Obviously this is the json representation of the NBT)

If an item - any item, vanilla or modded - gets put in the left or right slot of the Stapler, and it has a FabricSquare NbtCompound key on it with this data, it will be treated exactly the same as a lime wool block: It will take the block/lime_wool texture atlas sprite from the block/item atlas, pan down and to the right 4 pixels (to use the center 8x8), tint it white (no tint), and apply normal lighting (not emissive). In high-resolution texture packs, this will still represent a square in the center of the lime wool texture, half the texture's size.

A good way to check your work is whether you can insert the item into the Stapler. If it accepts the item, it detects that some kind of FabricSquare data is there.

Another cool trick:

"FabricSquare": {}

This is a missingno square. All keys are optional. There are no scarf police.

Example Scarf NBT

//This outer object represents the root tag of the Scarf
{
    "LeftScarf": [
        { //FabricSquare object, schema is identical to the items above
            "Id": "block/amethyst_block",
            "X": 4,
            "Y": 4,
            "Color": -1,
            "Emissive": true
        }
    ],
    "RightScarf": []
}

This scarf has only one square stapled to the left side: a glowing amethyst texture. This cannot be created with the tools provided in the mod. Only NBT crimes can do this.

Clone this wiki locally