Random Entities#

_images/icon21.png

Rabbits can be frogs#

Random Entities changes an entity’s texture based on its’ qualities, such as position, NBT rules, the day time, etc.

Random Entities is backwards compatible with Random Mobs. The textures and configurations in assets/minecraft/optifine/mob/ are also supported.

_images/settings11.png

Button and tooltip for the option, found in Video Settings ➔ Quality#

_images/piglin.png

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

For paintings:

  • assets/minecraft/textures/painting/paintings_kristoffer_zetterstrand.png

  • assets/minecraft/optifine/random/painting/paintings_kristoffer_zetterstrand2.png

  • assets/minecraft/optifine/random/painting/paintings_kristoffer_zetterstrand3.png

  • assets/minecraft/optifine/random/painting/paintings_kristoffer_zetterstrand4.png

  • etc.

  • assets/minecraft/optifine/random/painting/paintings_kristoffer_zetterstrand.properties

This file consists of a sequence of rules, numbered from 1.

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

<n> starts at 1

Key

Values

Meaning

textures.<n>

Values: List of texture indexes
Required: ✅ Yes
List of entity textures to use.
The texture index 1 is the default texture from assets/minecraft/texture.
Alternatively, the Random Mobs property skins.<n> can be used.

skins.<n>

Values: List of paths to textures, see above
Required: ❌ No

weights.<n>

Values: List of integers
Required: ❌ No
List of weights to apply to the random choice
Weights do not have to total 100, or any other particular value.
The number of weights should match the number of textures

biomes.<n>

Values: List of strings
Required: ❌ No
List of biomes
The vanilla biome names are listed here
Biomes added by mods can also be used

heights.<n>

Values: Range of integers
Required: ❌ No
Height ranges
Replaces legacy minHeight` and maxHeight properties.
Since 1.18, negative values may be specified for height. When used in a range they have to be put in parenthesis ( ).

name.<n>

Values: String
Required: ❌ No
Entity name
Uses syntax similar to NBT rules.

professions.<n>

Values: none, armorer, butcher, cartographer, cleric, farmer, fisherman, fletcher, leatherworker, librarian, mason, nitwit, shepherd, toolsmith, and weaponsmith, along with an optional level experience format
Required: ❌ No
List of villager professions with optional levels
Entry format: <profession>[:level1,level2,...]
Example:
Professions farmer (all levels) or librarian (levels 1,3,4): professions=farmer librarian:1,3-4
Professions fisher, shepard, nitwit: professions=fisherman shepherd nitwit

colors.<n>

Values: white, orange, magenta, light_blue, yellow, lime, pink, gray, light_gray, cyan, purple, blue, brown, green, red, and black
Required: ❌ No
List of wolf/cat collar colors or sheep/llama colors.
Example: colors.2=pink magenta purple
The legacy property collarColors is also recognized.

baby.<n>

Values: Boolean
Required: ❌ No

Only valid for mobs

health.<n>

Values: List of integers or ranges or percents
Required: ❌ No
Range of health values, can also be given in percent.
Only valid for mobs.
Example:
health.1=10
health.2=5-8 10-12
health.3=0-50%

moonPhase.<n>

Values: List of integers or ranges
Required: ❌ No
List of moon phases (0-7)
Example:
moonPhase.1=3
moonPhase.2=0 1 2
moonPhase.1=0-2 4-7

dayTime.<n>

Values: List of integers or ranges
Required: ❌ No
List of day times in ticks (0-24000)
Example:
dayTime.1=2000-10000
dayTime.2=0-1000 18000-24000

weather.<n>

Values: clear, rain, and thunder
Required: ❌ No
Several values can be specified separated by space
For example: weather=clear rain thunder

sizes

Values: Integer or list or integers or integer range
Required: ❌ No
Only valid for mobs with multiple sizes (0-255 for slimes and magma cubes and 0-64 for phantoms)
Slimes and magma cubes naturaly spawn in three sizes: 0=small, 1=medium, 3=big.
Naturaly spawing phantoms only spawn in one size: 0.
Example
sizes.1=3
sizes.2=0 1 3
sizes.3=0-2 4-7

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.

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

# Use 5, 7, 9 in high, hilly areas.
skins.2=5 7 9
biomes.2=ExtremeHills DesertHills ForestHills ExtremeHillsEdge JungleHills IceMountains
heights.2=80-255

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

Omit Vanilla Texture#

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

skins.1=2-16

🆚️ This documentation assumes the latest OptiFine version. Notes are not made for legacy versions (1.8).
🔙️ This documentation is updated to commit 8410499f.
©️ This file is offered without any copyright restrictions. Please copy and modify it to suit your needs. Credit is optional, but appreciated.