Units

List of supported measurement units
SuffixUnit typeDescription
chlengthRelative to the size of the ‘0’ character in minecraft’s minecraft:default font
pxlengthRelative to 1/40th (see notes below)
vwlengthRelative to 1/100th of the width of the document screen
vhlengthRelative to 1/100th of the height of the document screen
mlengthRelative to the size of 1 block
cmlengthRelative to 1/100th of a block
%lengthRelative to the parent’s size
degangleRepresents an angle in degrees. Relative to 1/360th of a circle
gradangleRepresents an angle in gradians. Relative to 1/400th of a circle
radangleRepresents an angle in radians
turnangleRepresents an angle with the number of rotations

Unit compatibility

Not all units are compatible with each other, the following is a list of compatible units and how they are handled.

UnitsHandling
cm, mm measurements are converted to cm
deg, grad, rad, turnUnits are converted to either degrees or radians based on use case (eg: to degrees for operators like + and - and to radians for math, like sin(x))

Notes

  • Pixels aren’t real, a pixel is defined as 1 / 40. This comes from the fact that an empty text display entity (Text display entity with content "") has a size that’s 1/40th of a block. Thus a pixel is 1/40th, or 0.025.