− | Textures, like models, are contained within resource packs and are referred to with <code>ResourceLocation</code>s. When <code>ResourceLocation</code>s refer to textures in models, the paths are taken to be relative to <code><nowiki>textures/</nowiki></code> (e.g. <code><nowiki>examplemod:blocks/test</nowiki></code> → <code><nowiki>assets/examplemod/textures/blocks/test.png</nowiki></code>). Additionally, in Minecraft, the [[https://en.wikipedia.org/wiki/UV_mapping UV coordinates/1.16]] (0,0) are taken to mean the ''<code>top-left</code>'' corner. UVs are <code>always</code> from 0 to 16. If a texture is larger or smaller, the coordinates are scaled to fit. A texture should also be square, and the side length of a texture should be a power of two, as doing otherwise breaks mipmapping. (E.g. 1x1, 2x2, 8x8, 16x16, and 128x128 are good. 5x5 and 30x30 are not recommended because they are not powers of 2. 5x10 and 4x8 are completely broken as they are not square.) If there is an <code>mcmeta</code> file associated with the texture, and an animation is defined, the image can be rectangular and is interpreted as a vertical sequence of square regions from top to bottom, where each square is a frame of the animation. | + | Textures, like models, are contained within resource packs and are referred to with <code>ResourceLocation</code>s. When <code>ResourceLocation</code>s refer to textures in models, the paths are taken to be relative to <code><nowiki>textures/</nowiki></code> (e.g. <code><nowiki>examplemod:blocks/test</nowiki></code> → <code><nowiki>assets/examplemod/textures/blocks/test.png</nowiki></code>). Additionally, in Minecraft, the [[https://en.wikipedia.org/wiki/UV mapping UV coordinates/1.16|https://en.wikipedia.org/wiki/UV mapping UV coordinates]] (0,0) are taken to mean the ''<code>top-left</code>'' corner. UVs are <code>always</code> from 0 to 16. If a texture is larger or smaller, the coordinates are scaled to fit. A texture should also be square, and the side length of a texture should be a power of two, as doing otherwise breaks mipmapping. (E.g. 1x1, 2x2, 8x8, 16x16, and 128x128 are good. 5x5 and 30x30 are not recommended because they are not powers of 2. 5x10 and 4x8 are completely broken as they are not square.) If there is an <code>mcmeta</code> file associated with the texture, and an animation is defined, the image can be rectangular and is interpreted as a vertical sequence of square regions from top to bottom, where each square is a frame of the animation. |