Dynamic Skins

Dynamic Skins

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

by
874 Downloads
fabricquiltutility
Rent Server with this Mod

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:

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:

// 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 resource pack.

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:

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

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

Available Versions

Dynamic Skins 1.2.1release
MC 1.20.1fabric, quilt
August 6, 2024
Dynamic Skins 1.2.0release
MC 1.20.1fabric, quilt
August 3, 2024
Dynamic Skins 1.1.0release
MC 1.20.1fabric, quilt
July 30, 2024
Dynamic Skins 1.0.1release
MC 1.20.1fabric, quilt
July 29, 2024
Dynamic Skins 1.0.0release
MC 1.20.1fabric, quilt
July 28, 2024

How to Install Dynamic Skins on Your Server

1

Order Server

Order a Minecraft Java server with at least 3 GB RAM (4 GB recommended).

2

Set fabric Loader

In the panel under "Egg", select the fabric loader and matching Minecraft version (1.20.1).

3

Install Mod

Open the mod browser in the dashboard and search for "Dynamic Skins". Click "Install" – done! Alternatively, upload the .jar via SFTP to the /mods folder.

Compatibility

Mod Loaders

fabricquilt

Minecraft Versions

1.20.1

Server-side

Unsupported

Recommended RAM

4 GB(min. 3 GB)

Frequently Asked Questions

Dynamic Skins server crashes on startup – what to do?

Most common cause: wrong fabric version or insufficient RAM. Check the server log (latest.log) for "OutOfMemoryError" or "Mixin" errors. With Mado Hosting: ensure at least 3 GB RAM is allocated and the loader matches the mod version (1.20.1). You can switch loaders with one click in the panel.

Is Dynamic Skins compatible with fabric and quilt?

Dynamic Skins officially supports fabric, quilt for Minecraft 1.20.1. The Mado dashboard automatically detects incompatible loader combinations.

Server lagging with Dynamic Skins – how to optimize performance?

Recommended RAM: 4 GB (per 8 players). Use /spark profiler to check if Dynamic Skins consumes the most tick time. Common fixes: reduce server view-distance to 8-10, install "performant" or "starlight" as supplementary mods on Forge. With Mado Hosting, your server runs on NVMe SSDs with dedicated CPU cores for minimal latency.

Rent Modded Server

Install Dynamic Skins with just one click on your server.

Recommended RAM
4 GBab €8/mo
Min. 3 GB | +1 GB pro 8 Spieler
Create Server Now
1-Click Mod Install
NVMe SSD Storage
DDoS Protection included

Details

License
MIT License
Server-side
Unsupported

Supported Versions

1.20.1