Wiki

Clone wiki

mcpatcher / Random_Mobs

Random mob textures

This feature allows you to create alternate appearances for each mob type and let the game randomly choose one each time a mob spawns. Alternates can be given varying probabilities to make rare "easter-egg" mobs. They can also be grouped by biome and depth to create snow-, desert-, or cave-themed mobs.

Randomization of horse textures is not supported, due to the way Minecraft blends multiple textures together for horses (a sort of Random Mobs-like effect in vanilla).

Simple randomization

Randomizing mob textures is easy. First, find the vanilla texture of the mob you want to randomize. Replace assets/minecraft/textures/entity/ with assets/minecraft/mcpatcher/mob/ in the path and add a number to the filename starting at 2.

The first alternate creeper texture is

assets/minecraft/mcpatcher/mob/creeper/creeper2.png

With just this texture, the game will use the vanilla creeper.png for 50% of creepers than spawn and your alternate creeper2.png for the other 50%.

Be sure to preserve subfolders under the entity/ folder! Compare the bolded parts below:

Creeper:
assets/minecraft/textures/entity/creeper/creeper.png
assets/minecraft/mcpatcher/mob/creeper/creeper2.png
assets/minecraft/mcpatcher/mob/creeper/creeper3.png
assets/minecraft/mcpatcher/mob/creeper/creeper4.png
etc.

WRONG! WILL NOT WORK:
assets/minecraft/mcpatcher/mob/creeper2.png

Chicken:
assets/minecraft/textures/entity/chicken.png
assets/minecraft/mcpatcher/mob/chicken2.png
assets/minecraft/mcpatcher/mob/chicken3.png
assets/minecraft/mcpatcher/mob/chicken4.png
etc.

Auxillary mob textures

Some mobs have multiple textures. For example the spider_eyes texture is separate from the main spider skin. Wolves have normal, angry, and tame textures. Other sets of related textures are:

  • creeper, creeper_armor
  • dragon, dragon_eyes
  • enderman, enderman_eyes
  • ghast, ghast_shooting
  • sheep, sheep_fur
  • spider, spider_eyes
  • wither, wither_armor, wither_invulnerable
  • wolf, wolf_angry, wolf_tame, wolf_collar

There are several ways to handle this.

  1. Provide multiple base skins and only one eyes texture. All mobs of that type will have the same eyes. If your eye texture is generic enough, this may be a viable option.

  2. Provide matching textures in equal numbers. If you have the same number of wolf, wolf_angry, and wolf_tame textures, for example, MCPatcher is guaranteed to use the corresponding skin whenever the wolf changes moods.

  3. Provide different numbers of each releated texture. This is probably not what you want as the results are highly unpredictable, but it could be useful if you have multiple base skins and multiple eye textures that look good in any combination.

Other overlay textures

Certain mobs also use fixed block textures. Mooshrooms use the red mushroom textures on their backs, and snowmen wear pumpkins on their heads. MCPatcher offers the ability to customize both of these textures. Multiple alternate replacement textures can be used and they will be randomized as any other auxillary mob texture.

Mooshroom:
assets/minecraft/mcpatcher/mob/cow/mooshroom_overlay.png
assets/minecraft/mcpatcher/mob/cow/mooshroom_overlay2.png
assets/minecraft/mcpatcher/mob/cow/mooshroom_overlay3.png
etc.

Snowman:
assets/minecraft/mcpatcher/mob/snowman_overlay.png
assets/minecraft/mcpatcher/mob/snowman_overlay2.png
assets/minecraft/mcpatcher/mob/snowman_overlay3.png
etc.

These textures use a special layout to fit their respective character models.

The mooshroom overlay consists of three square panels, one for each mushroom on the cow's back from head to tail. Each panel is rendered as a "crossed square" similar to mushrooms growing in the world. Template:

The snowman overlay is a simple cube with the sides arranged like this:

One option is to have a completely blank snowman_overlay.png and do all the customization on the base snowman.png textures instead.

Biome/depth rules and rarity

So far you are able to create a set of alternate textures and have the game choose one at random with equal probability. MCPatcher additionally allows you to make certain textures rarer than others or limit them to certain areas of the world by using a properties file. There is one properties file per mob type, using the name of the vanilla texture but in the mcpatcher directory:

Creeper:
assets/minecraft/mcpatcher/mob/creeper/creeper.properties

Chicken:
assets/minecraft/mcpatcher/mob/chicken.properties

Again, parallel the vanilla folder structure or the properties file will have no effect. If no properties file is present for a mob, then all availabletextures are used equally for that type.

Mobs with multiple textures will use the properties file for the base texture. In other words, you do not need to create wolf.properties, wolf_tame.properties, and wolf_angry.properties. Just wolf.properties will work for all three, provided you have the same number of textures for each. Similarly for *_eyes, and *_overlay, and others.

Properties file format (Template)

The file consists of a sequence of rules, numbered from 1. Each rule specifies a list of mob skins to use and one or more conditions under which to use them. The first rule that matches wins, so put more specific rules first and then generic ones toward the end. If no rule matches, the default texture (e.g., creeper.png) is used.

In each description below, replace <n> with the rule number.

(Required) Range of mob skins to use

skins.<n>=<list of mob skins to use>

List only the numbers, either individually or as ranges, e.g., skins.1=1 2 5-8 10.

(Optional) Rarity

weights.<n>=<same-sized list of weights>

You must provide as many weights as you did skins in the skins property. Each skin will have a probability of its weight divided by the sum of all weights, so lower-weighted skins are more rare. The weights are relative; they do not have to total 100 or any other particular value.

(Optional) Biomes

biomes.<n>=<biome list>

List of biomes, separated by commas, where this rule applies. See Minecraft wiki for a list. A mob's spawn point (single player) or where it is first seen by the client (multiplayer) determines its biome.

(Optional) Height range

minHeight.<n>=<y value>
maxHeight.<n>=<y value>

Specifies a range of y values in the world where these skins should be used. 0 <= minHeight <= maxHeight or the rule is ignored. A mob's spawn point (single player) or where it is first seen by the client (multiplayer) is used here.

Updated