Random Entities

File location

/assets/minecraft/optifine/random/**/*.png

/assets/minecraft/optifine/random/**/*.properties

_images/icon19.webp

Rabbits can be frogs.

Random Entities changes an entity's texture based on its qualities, such as position, NBT rules, the time, and more.

_images/settings13.webp

Video Settings ‣ Quality

_images/piglin.webp

Random entities applied to a Piglin

Vanilla textures are assigned a texture number of 1.

Files

This file can be placed in the optifine/random/ folder of the resource pack, parallel to the vanilla texture in textures/:

  • /assets/minecraft/textures/entity/creeper/creeper.png

  • /assets/minecraft/optifine/random/entity/creeper/creeper2.png

  • /assets/minecraft/optifine/random/entity/creeper/creeper3.png

  • /assets/minecraft/optifine/random/entity/creeper/creeper4.png

  • etc.

  • /assets/minecraft/optifine/random/entity/creeper/creeper.properties

Textures ending with a digit use the separator ..

  • /assets/minecraft/textures/entity/warden/warden_pulsating_spots_2.png

  • /assets/minecraft/optifine/random/entity/warden/warden_pulsating_spots_2.2.png

  • /assets/minecraft/optifine/random/entity/warden/warden_pulsating_spots_2.3.png

  • /assets/minecraft/optifine/random/entity/warden/warden_pulsating_spots_2.4.png

  • /assets/minecraft/optifine/random/entity/warden/warden_pulsating_spots_2.properties

The textures and configurations in /assets/minecraft/optifine/mob/ are also supported.

Matching order

Each rule specifies a range of entity textures to use and one or more conditions under which to use them.

The entity coordinates when it spawns (single player) or when it is first seen by the client (multiplayer) are checked against each rule in sequence.

The first rule that matches wins. If no rule matches, the default texture (e.g., creeper.png) is used.

If no .properties file is present for an entity, then all available textures are used for that type of entity.

Entities with multiple textures will use the .properties file for the base texture.

In other words, all of these do not need to be created explicitly:

  • wolf.properties

  • wolf_tame.properties

  • wolf_angry.properties

Just wolf.properties will work for all three, provided there are the same number of textures for each. Similarly for "_eyes" and "_overlay".

Properties

Important

For all of these, N is a number that links the individual properties together to form a rule. N starts at 1. You should not skip numbers.

textures.N

Type: List of integers

Required

List of entity texture indices to use when this rule matches.

Index 1 refers to the default vanilla texture (e.g., creeper.png). Higher numbers refer to alternate textures (creeper2.png, creeper3.png, etc.).

Legacy

The legacy property skins.N can be used instead.

weights.N

Type: List of integers

Optional

Weights for each texture in textures.N.

Weights do not need to sum to any specific value. The number of weights should match the number of textures.

A higher weight means a higher likelyhood to be chosen.

biomes.N

Type: List of strings

Values: Space-separated biome IDs

Optional

List of biome IDs where this rule applies.

If the first character is !, the list is inverted (matches any biome not in the list).

Example:

biomes.1=!jungle deep_ocean birch_forest

Modded biomes are supported using their IDs.

heights.N

Type: Integer or integer range

Optional

Heights where this rule applies.

Example: (-3)-64 for underground to sea level.

name.N

Type: String

Values: String matcher

Optional

Entity name (custom name) to match.

professions.N

Type: List of strings

Values: Any of none, armorer, butcher, cartographer, cleric, farmer, fisherman, fletcher, leatherworker, librarian, mason, nitwit, shepherd, toolsmith, weaponsmith

Optional

List of villager professions with optional levels.

Format: <profession>[:level1,level2,...]

Example:

professions.1=farmer librarian:1,3-4
professions.2=fisherman shepherd nitwit
colors.N

Type: List of strings

Values: white, orange, magenta, light_blue, yellow, lime, pink, gray, light_gray, cyan, purple, blue, brown, green, red, black

Optional

Collar, wool, shulker box, or bed colors.

Legacy

The legacy property collarColors is also recognized.

baby.N

Type: Boolean

Optional

Whether the entity is a baby (only valid for mobs that have baby variants).

health.N

Type: List of integers, integer ranges, or percentage ranges

Optional

Health range (absolute or percentage).

Example:

health.1=10
health.2=5-8 10-12
health.3=0-50%
moonPhase.N

Type: Integer or integer range

Values: From 0 to 7

Optional

Moon phases when the rule applies.

Example:

moonPhase.1=3
moonPhase.2=0 1 2
moonPhase.3=0-2 4-7
dayTime.N

Type: Integer or integer range

Values: From 0 to 24000

Optional

Time of day in ticks when the rule applies.

Example:

dayTime.1=2000-10000
dayTime.2=0-1000 18000-24000
weather.N

Type: List of strings

Values: Any of clear, rain, thunder

Optional

Weather conditions when the rule applies.

sizes.N

Type: Integer or integer range

Optional

Size of the entity (only for mobs with size variants: slimes/magma cubes 0–255, phantoms 0–64).

Example:

sizes.1=0
sizes.2=1 3
sizes.3=0-2 4-7
nbt.N.TAG

Type: String

Values: NBT rule

Optional

NBT-based matching rule.

Pitfall

See Client-side data.

blocks.N

Type: String

Values: Block ID

Optional

Block the entity is standing on (for living entities) or the block itself (for block entities).

Examples

Creeper

Uses creeper10.png through creeper14.png for all underground creepers. creeper13.png will be used 7.3% (3/(10+10+10+3+10)) of the time.

textures.1=10-14
weights.1=10 10 10 3 10
heights.1=0-55

# Use 5, 7, 9 in high, hilly areas.
textures.2=5 7 9
biomes.2=windswept_hills desert forest badlands jagged_peaks stony_peaks
heights.2=80-255

# Fallback rule if nothing else matches.
# Remember that if no rule matches, only the base creeper/creeper.png will be used.
textures.3=1-4 6 8 15-20

Omit Vanilla texture

Uses slime2.png through slime16.png for all slimes, not including the vanilla texture.

textures.1=2-16

Warning

These resources are not related to OptiDocs, but may provide some help.


Assumes the latest OptiFine & Minecraft versions.
Updated to commit 83d482c3.