Clone wiki

mcpatcher / Dial_Animations

Custom Dial Animations

Vanilla Minecraft lets you create custom clock and compass textures as a strip
of vertical frames, one for each possible orientation of the clock hands or
compass needle. While this offers a lot of flexibility, it is inefficient for
producing smooth animations at higher resolutions.

MCPatcher offers an alternate method suitable for creating smoother-looking
analog dial animations. Using this method not prevent you from also providing
a vanilla compass or clock animation in your texture pack, and in fact you
should provide one as a fallback for non-MCPatcher users if possible.

Each dial animation is specified as a series of texture layers. Some layers
can be fixed, others can rotate based on the direction to spawn (compass) or
time of day (clock). Layers are rendered one on top of another using blending
methods you specify.

Properties file format (Template)

Create a properties file for the animation you wish to customize:

  • Clock: assets/minecraft/mcpatcher/dial/
  • Compass: assets/minecraft/mcpatcher/dial/

(Required) Source texture


The texture for this layer. See
About Properties Files for how to specify paths to
texture files.

The first (bottommost) layer is source.0. Subsequent layers use source.1,
source.2, etc.

Bilinear filtering can be enabled for any layer using a lesser-known vanilla
trick. Create an mcmeta file in the same directory as the source texture and
add the following bit of JSON code:

  "texture": {
    "blur": true,
    "clamp": false

(Optional) Layer scaling


Expand or shrink the texture along the x- or y-axis. The default is no scaling
(1.0 in both directions).

(Optional) Layer offset


Offset the texture by a fixed amount. Use the range -1 .. 1. The default is
0.0 in both directions.

(Optional) Blend method


Specifies how to combine this layer with the previous ones. See
About Properties Files for a list of recognized
blending methods. The default is alpha blending.

(Optional) Rotation


Multiplier and offset applied to the angle before rendering. For the compass,
this always points away from spawn. For the clock, the angle is the time of
day: 0 = midnight 90 = 6am, 180 = noon, 270 = 6pm.

The formula used is

displayed angle = rotationSpeed * original angle + rotationOffset

Generally, rotationSpeed is either 0 (for fixed layers such as a clock base) or
1 (for the needle/dial), but other values can be used to create things like
hour and minute hands. Negative values cause the texture to rotate backwards.
Non-integer values will likely produce strange behavior.

The simplest case, a compass with a fixed base and a rotating needle, looks


The scaleY=0.5 property gives it the appearance of tilting into the screen.

Due to a quirk in the game's code, the compass needle actually points away
from spawn. So compass_dial.png should have the needle pointing south (down).
If it is pointing up, either flip it in an image editor or, equivalently, add a
rotationOffset property:


Additional properties

Converting your custom dial animation to vanilla format

outputFrames=<number of animation frames>


Add this property to quickly generate a default vanilla-style animation strip,
which you can use as a fallback for players without custom compass/clock

When the game starts up, a series of frames 360/n degrees apart will be
rendered into an animation at custom_{compass,clock}.png in your .minecraft
folder. Open the file in an image editor, and once you are satisfied with it,
move it to assets/minecraft/textures/items/{compass,clock}.png in your texture