Home›Java›Mods›Pi's Cosmetics
Pi's Cosmetics
ModsJava

Pi's Cosmetics

Java mod listed for Minecraft 1.21. Downloads from the MC Java Mods app on Android.

by Pi-Eta · on Modrinth

Adds a custom renderer using Gecklib that allows cosmetics to be rendered on players, including animation and custom particle support. Also has support…

⬇ Download on Modrinth

Framework

This mod renders cosmetics physically on the player model, on Fabric and NeoForge for Minecraft 1.21.1. It works on its own (vanilla armour slots), and also supports the Accessories mod, Mega Showdown mod and Genesis Forms when they are installed, so that items in all their slots can be rendered too. All three are optional; only GeckoLib (and Fabric API on Fabric) is required. Rendering is done through a custom pipeline that uses Geckolib, allowing for animated attachments and features of textures like transparency and emission.

The mod only contains generic items which can be cloned and overidden in many aspects with datapack JSONs and an accompanying resourcepack. This allows users to add their own custom cosmetics that are worn in any slot provided by Accessories and Mega Showdown, and to give the key items of Mega Showdown and Genesis Forms their own looks.

Datapack

New items are effectively copies of existing generic items with NBT data. To override the appearance of generic items, they must be specified in a datapack, structured as data/your_namespace/cosmetic/newitem.json.

Cosmetics use the universal cosmetic item, which goes in whatever slot the JSON's "slot" field says:

/give @s piscosmetics:cosmetic[custom_data={cosmetic:"your_namespace:my_cool_hat"}]
📁 your_datapack/
├── pack.mcmeta                      
├── pack.png                         
└── 📁 data/
    └── 📁 your_namespace/             
        └── 📁 cosmetic/                  
            ├── my_cool_hat.json
            ├── special_sword.json
            └── ...

The contents of the JSON file determine the various properties of the NBT tagged item. All fields except "slot" are optional and will fall back onto default values if left empty. The following fields are available:

{
    "slot": "feet",
    "name": "Dragon Boots",
    "color": "gold",
    "model": "your_namespace:cosmetic_feet",
    "texture": "your_namespace:cosmetic_feet",
    "animation": "your_namespace:cosmetic_feet",
    "attach": "right_leg",
    "translate_x": 0.1,
    "translate_y": 0.2,
    "translate_z": -0.1,
    "rotate_x": 5.0,
    "rotate_y": 10.0,
    "rotate_z": 0.0,
    "scale": 0.9,
    "hide_armor": ["feet", "elytra"],
    "icon": "your_namespace:item/cosmetic_feet",
    "copyable": true,
    "particle_emitters": [
        {
            "trigger": "walking",
            "particle": "minecraft:end_rod",
            "rate": 5,
            "spread": 0.3,
            "count": 2,
            "offset_y": 0.1
        },
        {
            "trigger": "sprinting",
            "particle": "piscosmetics:cosmetic_particle",
            "rate": 10,
            "spread": 0.5,
            "count": 1,
            "offset_y": 0.5,
            "custom_size": 0.5,
            "lifetime": 20,
            "texture": "your_namespace:lettera"
        },
        {
            "trigger": "jumping",
            "particle": "minecraft:entity_effect",
            "rate": 3,
            "spread": 1.0,
            "count": 5,
            "offset_y": 0.0,
            "color": "#FF5500"
        }
    ]
}

Note

When specifying resource locations, always only use your_namespace:filename without any folder or suffixes.

Key Items

The key items of Mega Showdown and Genesis Forms (Key Stones, Mega Bracelets, Z-Rings, Dynamax Bands, Tera Orbs and so on) can be drawn as cosmetics while worn. The item keeps working exactly as before. With Genesis Forms installed, its key items can be worn in these Accessories slots: wrist (mega_bracelet, mega_cuff, dynamax_band), ring (mega_ring, z_ring, z_power_ring, key_stone), necklace (mega_charm) and belt (tera_orb).

There are two ways to give a key item a look:

/give @s genesisforms:key_stone[custom_data={cosmetic:"your_namespace:golden_key_stone"}]

An item with its own look shows it in the tooltip (Look: ...). To take the look off, put the item alone in a grindstone. It comes out plain, and nothing is given back.

Blueprints

A blueprint carries one cosmetic and is used up in a smithing table. Blank blueprints are crafted from a paper and a lapis lazuli. Every cosmetic's blueprint is in the "Pi's Cosmetics" creative tab, or can be given with:

/give @s piscosmetics:cosmetic_blueprint[custom_data={blueprint:"your_namespace:my_cool_hat"}]

In the smithing table, put the blueprint in the left slot and leave the right slot empty. What goes in the middle decides what comes out:

Two cosmetic fields control blueprints:

For server owners

All of these can be changed in a datapack:

Blueprints can also be handed out through loot tables with vanilla's set_custom_data function.

Resourcepack

Your resourcepack should be structured as follows:

📁 your_resourcepack/
└── 📁 assets/
    └── 📁 your_namespace/
        ├── 📁 geo/
        │   └── 📁 item/
        │       └── my_cool_hat.geo.json
        │
        ├── 📁 textures/
        │   └── 📁 item/
        │       └── my_cool_hat.png
        │   └── 📁 particle/
        │       └── my_particle.png
        │
        └── 📁 animations/
            └── my_cool_hat.animation.json

By default, the renderer handles transparent/translucent textures.

For emissive textures, simply add another texture file suffixed with _emissive.png. The mod will automatically match that to an identically named texture and apply the glow based on the emissive file's transparency.

Models

Models used must be in the .geo.json format. It is recommended that you model or convert an existing model in Blockbench to a Bedrock Entity with per-face UVs, with a single bone on the topmost level.

It is generally good practice to have the origin of the topmost bone be [0, 0, 0] for easy testing of the correct offset values.

Example:

{
    "format_version": "1.12.0",
    "minecraft:geometry": [
        {
            "description": {
                "identifier": "geometry.test_cube",
                "texture_width": 16,
                "texture_height": 16
            },
            "bones": [
                {
                    "name": "bone",
                    "pivot": [0, 0, 0],
                    "cubes": [
                        {
                            "origin": [-8, -8, 0],
                            "size": [16, 16, 1],
                            "uv": [0, 0]
                        }
                    ]
                }
            ]
        }
    ]
}

Textures are generally 16x or 32x, but can be any size theoretically as per-face UVs support them.

Animations are detected and applied in a similar manner as emissive textures.

Dynamic Animations

The renderer is capable of applying directional animation switches in accordance with the player model. The idea is to simulate the swaying of soft bodies when the direction of the wearing changes This is set up within the animation file itself, by creating animations named as follows:

The glide animation switch can be used in tandem with elytra hiding and particle generation trigger while gliding to create animated wings with trailing effects.

Acknowledgements

Thank you to:

Todredmi for challenging me to evolve this for Fabric.

Noowtie for sending me down this rabbit hole in the first place.

Puremask for providing very enlightening code samples, especially for serverside particle rendering.

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

File checked by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more