Dynamic Skins

⭐ — (23 endorsements) 📥 948 downloads 📌 v1.2.1 📅 7/29/2024
⚪ Last updated 2024

By diacritics-owo · fabric

⬇ Download Mod Source: Modrinth ↗ 📅 Updated: 8/6/2024 📅 Created: 7/29/2024
⚠️ Install Order · 2 steps
1🛠️ Forge — Minecraft Forge (mod loader) Download ↗
2🛠️ Fabric — Fabric Loader Download ↗

Install in this order, then this mod last — most mods fail to load without their framework and dependencies in place.

🔍 Analysis

  • 👍 2.4% endorsement rate — high engagement, a strong quality signal
  • 🏆 #868 of 885 fabric mods in this game by downloads

📋 About This Mod

# Dynamic Skins Set your skin dynamically based on conditions (client-only for now) ## Getting Started After installing the mod and launching the game once, a file called `dynamic-skins.js` will be written to the configuration folder (if you don't know where that is, Dynamic Skins will helpfully tell you the file path in the logs on the first launch). Dynamic Skins exposes a very simple JavaScript API that allows you to replace player skins based on conditions that you define. **Note that the skin replacement only takes place on _your_ client. Only you will see the modified skins.** Also note that this only changes skins in-game, so skin selector mods or the tab list/social interactions screen will not be affected. Example configuration: ```javascript if ( data.target.player.profile.username === data.client.player.profile.username && // Only replace your own skin - without this, you'll see that everyone's skin changes when you swim data.client.player.isTouchingWater && data.client.player.isSwimming ) { skin.set("minecraft:textures/entity/zombie/drowned_outer_layer.png"); } ``` Another: ```javascript // When anyone holds a trident, their skin will be changed if (data.target.player.equipment.mainhand === "minecraft:trident") { skin.set("minecraft:textures/entity/zombie/drowned_outer_layer.png"); } ``` This configuration will be run once per player rendered per frame. ## Configuration Cache The configuration is read once on mod initialisation and cached in memory, and updates to it will not be read unless you run `/dynamic-skins cache reload`. Alternatively, you can open the Mod Menu configuration page for Dynamic Skins and click "Reload configuration". Every time you update the configuration, you must reload it for it to apply. ## Errors If an error is encountered when Dynamic Skins executes the configuration, the error and a message stating that Dynamic Skins has stopped will be logged. You can run the command `/dynamic-skins error` to display the error. To start it again, you must either run `/dynamic-skins error reset` or open the Mod Menu page (reopen if it was already open) and click the "Restart" button that should now be visible. Note that restarting will reload the configuration. ## Custom Skins For now, Dynamic Skins only allows you to set a skin via a resource location (of the form `namespace:path/to/image.png`). To use custom skins, you can create a (https://minecraft.wiki/w/Resource_pack#Java_Edition). Example resource pack structure: ``` |- pack.mcmeta |- pack.png |- assets |- skins |- my_skin.png ``` You could then use `skin.set('skins:my_skin.png')`. ## Advanced Usage Dynamic Skins allows you to set a state that persists across both players and frames. This allows you to make animated skins by cycling through different frames. Please note that framerates drop significantly with long cycles. Example: ```javascript if ( data.target.player.profile.username === data.client.player.profile.username ) { state.set( "cycle", ((state.get("cycle") === null ? 0 : state.get("cycle")) % 32) + 1 ); const s = state.get("cycle").toString(); skin.set(`skins:skin${"0".repeat(2 - s.length)}${s}.png`); } ``` The above example will cycle your skin continuously from `skins:01.png` through `skins:32.png` It is possible to cycle skins without state by using `skin.value`, but it will be much more tedious and will still have a performance impact. <img src="https://github.com/diacritics-owo/dynamic-skins/raw/main/assets/gradient-skin.gif" alt="a gif of the skin cycling through different gradients" /> ## API ### `Skin` #### `value: string` #### `set(value: string): void` --- ### `Data` #### `client: ClientData` #### `target: TargetData` --- ### `ClientData` #### `player: PlayerData` --- ### `TargetData` #### `player: PlayerData` --- ### `PlayerData` #### `profile: ProfileData` #### `equipment: EquipmentData` #### `isTouchingWater: boolean` #### `isClimbing: boolean` #### `isSwimming: boolean` #### `isSneaking: boolean` #### `isOnFire: boolean` #### `isInLava: boolean` #### `isSprinting: boolean` --- ### `ProfileData` #### `username: string` --- ### `EquipmentData` #### `head: string` #### `chest: string` #### `legs: string` #### `feet: string` #### `mainhand: string` #### `offhand: string` --- ### `State` #### `set(key: string, value: any): void` #### `get(key: string): any`

# Dynamic Skins

Set your skin dynamically based on conditions (client-only for now)

## Getting Started

After installing the mod and launching the game once, a file called `dynamic-skins.js` will be written to the configuration folder (if you don't know where that is, Dynamic Skins will helpfully tell you the file path in the logs on the first launch).

Dynamic Skins exposes a very simple JavaScript API that allows you to replace player skins based on conditions that you define. Note that the skin replacement only takes place on _your_ client. Only you will see the modified skins. Also note that this only changes skins in-game, so skin selector mods or the tab list/social interactions screen will not be affected.

Example configuration:

```javascript if ( data.target.player.profile.username === data.client.player.profile.username && // Only replace your own skin - without this, you'll see that everyone's skin changes when you swim data.client.player.isTouchingWater && data.client.player.isSwimming ) { skin.set("minecraft:textures/entity/zombie/drowned_outer_layer.png"); } ```

```javascript // When anyone holds a trident, their skin will be changed if (data.target.player.equipment.mainhand === "minecraft:trident") { skin.set("minecraft:textures/entity/zombie/drowned_outer_layer.png"); } ```

This configuration will be run once per player rendered per frame.

## Configuration Cache

The configuration is read once on mod initialisation and cached in memory, and updates to it will not be read unless you run `/dynamic-skins cache reload`. Alternatively, you can open the Mod Menu configuration page for Dynamic Skins and click "Reload configuration". Every time you update the configuration, you must reload it for it to apply.

If an error is encountered when Dynamic Skins executes the configuration, the error and a message stating that Dynamic Skins has stopped will be logged. You can run the command `/dynamic-skins error` to display the error. To start it again, you must either run `/dynamic-skins error reset` or open the Mod Menu page (reopen if it was already open) and click the "Restart" button that should now be visible. Note that restarting will reload the configuration.

## Custom Skins

For now, Dynamic Skins only allows you to set a skin via a resource location (of the form `namespace:path/to/image.png`). To use custom skins, you can create a (https://minecraft.wiki/w/Resource_pack#Java_Edition).

Example resource pack structure:

``` |- pack.mcmeta |- pack.png |- assets |- skins |- my_skin.png ```

You could then use `skin.set('skins:my_skin.png')`.

## Advanced Usage

Dynamic Skins allows you to set a state that persists across both players and frames. This allows you to make animated skins by cycling through different frames. Please note that framerates drop significantly with long cycles.

```javascript if ( data.target.player.profile.username === data.client.player.profile.username ) { state.set( "cycle", ((state.get("cycle") === null ? 0 : state.get("cycle")) % 32) + 1 );

const s = state.get("cycle").toString();

skin.set(`skins:skin${"0".repeat(2 - s.length)}${s}.png`); } ```

The above example will cycle your skin continuously from `skins:01.png` through `skins:32.png`

It is possible to cycle skins without state by using `skin.value`, but it will be much more tedious and will still have a performance impact.

a gif of the skin cycling through different gradients

#### `value: string`

#### `set(value: string): void`

#### `client: ClientData`

#### `target: TargetData`

### `ClientData`

#### `player: PlayerData`

### `TargetData`

#### `player: PlayerData`

### `PlayerData`

#### `profile: ProfileData`

#### `equipment: EquipmentData`

#### `isTouchingWater: boolean`

#### `isClimbing: boolean`

#### `isSwimming: boolean`

#### `isSneaking: boolean`

#### `isOnFire: boolean`

#### `isInLava: boolean`

#### `isSprinting: boolean`

### `ProfileData`

#### `username: string`

### `EquipmentData`

#### `head: string`

#### `chest: string`

#### `legs: string`

#### `feet: string`

#### `mainhand: string`

#### `offhand: string`

### `State`

#### `set(key: string, value: any): void`

#### `get(key: string): any`

🤖 AI-enhanced — based on mod data

📊 Mod Details

Game
Minecraft Mods
Author
diacritics-owo
Version
1.2.1
Downloads
948
Endorsements
23
Category
fabric
Created
7/29/2024
Updated
8/6/2024
Game Versions
1.20.1
Tags
utility

🔧 How to Install Minecraft Mods Mods

Download from Modrinth. Use Prism Launcher or drop into your mods folder.

📖 Full step-by-step install guide for Minecraft Mods →

Visit the official mod page for specific installation instructions for this mod.

🎮 Need cheat codes or console commands? Check ur gaming wiki for Minecraft Mods commands, item IDs, and more.

❓ Frequently Asked Questions

Which Minecraft Mods versions does Dynamic Skins support?

The author lists 1.20.1. Other versions may work but are untested by the author.

What is the latest version of Dynamic Skins?

Version 1.2.1, published 2024-08-06 with 948 downloads recorded at the source.

Keep browsing — more Minecraft Mods mods await

📋 All Minecraft Mods Mods 🏆 Top 25 📂 More fabric 👤 More by diacritics-owo 🔎 Similar Mods 🌐 Best fabric (All Games) 🔀 Check Compatibility ⚖️ Compare Mods 🆕 New Mods