|
| 1 | +--- |
| 2 | +title: Texture Slots |
| 3 | +description: Swap the textures on parts of your rig at runtime with Texture Slots. |
| 4 | +--- |
| 5 | + |
| 6 | +# Texture Slots |
| 7 | + |
| 8 | +## What is a Texture Slot? |
| 9 | + |
| 10 | +A **Texture Slot** is a group of interchangeable textures. You paint faces with the slot instead of a single texture, and every one of those faces can then switch to any texture in the slot, in the editor and in-game. |
| 11 | + |
| 12 | +Slots are perfect for anything with a few alternative looks: eyes that blink, a screen with several images, a shirt in different colors. |
| 13 | + |
| 14 | +The first texture in a slot is its **default**. Faces show it until something switches the slot. |
| 15 | + |
| 16 | +## Creating a Slot |
| 17 | + |
| 18 | +1. In the **Textures** panel, select the textures you want in the slot. Hold `Ctrl` or `Shift` to select several. |
| 19 | +2. Click **Create Texture Slot** in the Textures panel's toolbar. |
| 20 | +3. Name the slot in the dialog that opens. |
| 21 | + |
| 22 | +The slot appears in the Textures panel like any other texture, with its own icon. |
| 23 | + |
| 24 | +### The Texture Slot Dialog |
| 25 | + |
| 26 | +Double-click a slot (or right-click it and choose **Texture Slot Properties**) to edit it: |
| 27 | + |
| 28 | +- **Name**: used to name the slot's functions and models when exporting. |
| 29 | +- **Textures**: every texture in the slot. Drag them to reorder; the first one is the default. Use **Add Texture** to add more, and the eye icon to show a texture in the editor. |
| 30 | + |
| 31 | +## Using a Slot |
| 32 | + |
| 33 | +Apply a slot to faces the same way you'd apply a texture: select the faces or Cubes, then right-click the slot and choose **Apply to Faces** or **Apply to Elements**. |
| 34 | + |
| 35 | +- To preview another texture in the editor, right-click the slot and pick one under **Preview**. Previews aren't saved. |
| 36 | +- Painting on a slot paints whichever texture it's currently showing. |
| 37 | +- Deleting a slot moves its faces back to the slot's default texture. |
| 38 | + |
| 39 | +## Switching Slots In-Game |
| 40 | + |
| 41 | +There are three ways to change what a slot shows: |
| 42 | + |
| 43 | +- **Functions:** each slot gets a function per texture, like `my_pack:my_rig/texture_slots/eyes/closed`. See [Function API: Texture Slots](/docs/function-api/texture-slots). |
| 44 | +- **[Variants](/docs/core-concepts/variants):** a Variant picks a texture for any of your slots, and applies them all at once. |
| 45 | +- **Texture Slot keyframes:** switch slots at a specific frame of an [animation](/docs/core-concepts/animations#effect-keyframes). |
| 46 | + |
| 47 | +Each slot switches independently. Changing `eyes` never affects `shirt`, even on the same bone. |
| 48 | + |
| 49 | +### Names |
| 50 | + |
| 51 | +Slot and texture names are turned into function names when exporting: they're lowercased, a trailing `.png` is removed, and anything other than letters, digits, and underscores becomes `_`. A texture named `Eyes Closed.png` becomes `eyes_closed`. If two names end up the same, Animated Java adds a number to keep them unique. |
| 52 | + |
| 53 | +## Version Support |
| 54 | + |
| 55 | +Switching a single slot needs **Minecraft 1.21.4 or newer**. On older versions, the slot functions and Texture Slot keyframes aren't available, and slots only change when a Variant is applied (see [Layering Variants](/docs/core-concepts/variants#layering-variants)). |
| 56 | + |
| 57 | +:::info[How it works] |
| 58 | +On 1.21.4 and newer, each bone's item stores the texture name of every slot it uses in its `minecraft:custom_model_data` strings, and its item model picks textures from those strings. Switching a slot just rewrites one string, so no extra models are needed. |
| 59 | +::: |
| 60 | + |
| 61 | +## Upgrading Older Blueprints |
| 62 | + |
| 63 | +Before 1.11, Variants swapped textures with a texture map. Opening an older Blueprint turns each swapped texture into a Texture Slot holding it and every texture it was swapped to, and updates its Variants to use those slots. Your Variants look the same as before. |
| 64 | + |
| 65 | +## Related Reading |
| 66 | + |
| 67 | +- [Variants](/docs/core-concepts/variants) |
| 68 | +- [Function API: Texture Slots](/docs/function-api/texture-slots) |
| 69 | +- [Animations](/docs/core-concepts/animations) |
0 commit comments