Dynamic Skins
The Dynamic Skins modification allows you to automatically change player skins based on various in-game conditions. It's important to note that all changes are displayed only on your client - other players will see standard skins.
Getting Started
After installing the mod and launching the game for the first time, a file called dynamic-skins.js will appear in the configuration folder. If you don't know the location of this folder, the mod will output the full file path in the logs during the first launch.
The mod provides a simple JavaScript API for creating skin change conditions. You can configure skin replacement for various game situations, such as when the character is in water or using specific items.
Configuration example:
if (
data.target.player.profile.username === data.client.player.profile.username && // Replace only your own skin
data.client.player.isTouchingWater &&
data.client.player.isSwimming
) {
skin.set("minecraft:textures/entity/zombie/drowned_outer_layer.png");
}
Another example:
// Skin change when using a trident
if (data.target.player.equipment.mainhand === "minecraft:trident") {
skin.set("minecraft:textures/entity/zombie/drowned_outer_layer.png");
}
The configuration is executed for each displayed player in every frame.
Configuration Caching
Settings are loaded once during mod initialization and stored in memory. To apply changes to the configuration file, you need to run the /dynamic-skins cache reload command or use the "Reload configuration" button in the mod menu.
Error Handling
If errors occur in Dynamic Skins operation, corresponding messages will appear in the logs. Use the /dynamic-skins error command to view detailed error information. To resume mod operation after an error, run /dynamic-skins error reset or click the "Restart" button in the mod menu.
Custom Skins
The current version of the mod supports setting skins through resource locations in the format namespace:path/to/image.png. To use your own skins, create a resource pack with the following structure:
|- pack.mcmeta
|- pack.png
|- assets
|- skins
|- my_skin.png
After this, you can use the command skin.set('skins:my_skin.png').
Advanced Features
The mod supports state persistence between frames and players, allowing you to create animated skins with sequential frame changes. Note that long animation cycles may reduce performance.
Animated skin 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);
}
This code will cyclically change the skin from skins:01.png to skins:32.png.

API Reference
Skin
value: stringset(value: string): void
Data
client: ClientDatatarget: TargetData
ClientData
player: PlayerData
TargetData
player: PlayerData
PlayerData
profile: ProfileDataequipment: EquipmentDataisTouchingWater: booleanisClimbing: booleanisSwimming: booleanisSneaking: booleanisOnFire: booleanisInLava: booleanisSprinting: boolean
ProfileData
username: string
EquipmentData
head: stringchest: stringlegs: stringfeet: stringmainhand: stringoffhand: string
State
set(key: string, value: any): voidget(key: string): any