Play Strawberry Docs
Scripts

Resource packs

Describe your resource pack once and build the Java and the Bedrock zip from it with strawberry-kit, the same bytes every time.

One description, two packs

You write your pack once, as a description in JSON: block retextures, sounds, language lines and items. strawberry-kit pack build turns it into a Java zip and a Bedrock zip. You never keep a finished Java pack by hand, and both editions always come from the same files.

Nothing is replaced by a placeholder and nothing is dropped without a word: what the tool cannot build is refused with the reason, and the build report names what reaches Java players only.

Get the tool

strawberry-kit comes from the Play Strawberry registry, like the SDK (Get the SDK):

bash
cargo install strawberry-kit --registry strawberry

The description

Keep the description and its files in one folder of your project, for example pack/:

pack/look.json
{
  "name": "my-pack",
  "namespace": "my_pack",
  "description": "My server's look",
  "generation": 1,
  "retextures": [
    { "block": "yellow_wool", "texture": "carpet", "file": "textures/carpet.png" },
    { "block": "smooth_stone", "faces": {
        "up":   { "texture": "stone_top",  "file": "textures/stone_top.png" },
        "down": { "texture": "stone_top",  "file": "textures/stone_top.png" },
        "side": { "texture": "stone_side", "file": "textures/stone_side.png" } } }
  ],
  "sounds": [
    { "name": "hum", "file": "sounds/hum.ogg", "stream": true, "category": "ambient", "positional": false,
      "subtitle": { "en": "Humming", "fr": "Bourdonnement", "es": "Zumbido", "tr": "Vızıltı" } }
  ],
  "lines": [
    { "key": "my_pack.card", "en": "Switch", "fr": "Interrupteur", "es": "Interruptor", "tr": "Anahtar" }
  ],
  "items": [
    { "name": "ruby", "stack": 16, "base": "minecraft:paper", "file": "textures/ruby.png",
      "names": { "en": "Ruby", "fr": "Rubis", "es": "Rubí", "tr": "Yakut" } }
  ]
}
  • name names the zips; namespace is where your textures, sounds and lines live in the pack.
  • generation is the pack's generation. When the Bedrock content changes, the next build must be the next generation, so Bedrock players never stay on an old copy; when it did not change, the generation stays. The tool tells you which number it expects.
  • Every text comes in English, French, Spanish and Turkish.
  • File paths are plain relative paths with forward slashes. The tool reads nothing outside the description's folder.
  • Unknown fields are refused, so a misspelt setting is never ignored.

Items with a 3D shape

An item can have its own shape instead of a flat picture: export it from Blockbench as a "Java Block/Item" model and name the model and its picture.

json
"items": [
  { "name": "lantern_staff", "stack": 1, "base": "minecraft:stick", "model": "models/lantern_staff.json",
    "textures": [ { "texture": "lantern_staff", "file": "textures/lantern_staff.png" } ],
    "names": { "en": "Lantern Staff", "fr": "Bâton-lanterne", "es": "Bastón farol", "tr": "Fener Asası" } }
]
  • Java players see the model as you made it, in the hand, on the head, on the ground and in an item frame.
  • Bedrock players see the same shape in their hand and on their head, held where your model's display settings place it. In the inventory they see an icon the tool draws from the model, the way Java shows it in a slot.
  • Draw the whole model with one picture. A model that uses several pictures, or a picture of the game's own, reaches Java players only; the tool says so and a Bedrock player sees the base item. Put the pictures into one image in Blockbench to fix it.
  • A model with item/generated or item/handheld and one picture is a flat item, and both editions draw it flat.

Which blocks you can retexture

strawberry-kit pack blocks lists every block a pack can give its own texture, with the faces it takes and the light it gives. A retextured block keeps everything else: its sound, its light, how it breaks and what it drops.

  • Plain cubes (wool, concrete, terracotta, stones and bricks, the ore blocks and more) take one image, or up, down and side.
  • Glowstone, shroomlight, the froglights, the lit redstone lamp and the jack o'lantern keep their light. The redstone lamp has two blocks, redstone_lamp and redstone_lamp_on, so you can give it a look for off and one for on.
  • Froglights stand or lie like logs: both ends show the up image.
  • carved_pumpkin and jack_o_lantern have a front, which faces the player who placed them:
json
{ "block": "jack_o_lantern", "faces": {
    "front": { "texture": "lamp_face", "file": "textures/lamp_face.png" },
    "side":  { "texture": "lamp_side", "file": "textures/lamp_side.png" },
    "up":    { "texture": "lamp_top",  "file": "textures/lamp_top.png" },
    "down":  { "texture": "lamp_top",  "file": "textures/lamp_top.png" } } }

A block outside the list is refused with its reason, so it never looks different on Java and on Bedrock.

The game's own pictures and screens

Two more lists change what the game itself draws. Block pictures and many interface sprites reach Bedrock players too; the rest is for Java players, and the build says so for each one.

json
"textures": [
  { "path": "gui/container/inventory", "file": "gui/inventory.png" }
],
"sprites": [
  { "path": "tooltip/frame", "file": "gui/frame.png",
    "scaling": { "type": "nine_slice", "width": 100, "height": 100, "border": 4 } },
  { "path": "tooltip/background", "file": "gui/background.png" }
]
  • textures replaces a block or item texture (block/<name>, item/<name>: square, at most 256 x 256) or a container screen (gui/container/inventory, gui/container/generic_54 for a chest, gui/container/crafting_table, ...: 256 x 256).
  • A block picture (block/<name>) is changed for Bedrock players too when Bedrock has the same picture, which is the case for about 900 of them: planks, logs, doors, trapdoors, wool, concrete, terracotta, stones, ores and many more. You write the Java name; the tool finds Bedrock's own name for it (block/iron_door_top is the iron door on both). A few stay Java only, and the build names them: pictures Bedrock tints or lights by a mask (leaves, grass), pictures Bedrock animates itself (lava, fire, the sea lantern), item pictures and screens.
  • sprites replaces an interface sprite under hud/, icon/, container/, widget/, tooltip/ (the box that describes an item) or boss_bar/. An item can have a box of its own: give it the tooltip_style component with a style name, and add the sprites tooltip/<style>_background and tooltip/<style>_frame.
  • A sprite reaches Bedrock players too when Bedrock has the same picture, at the same size: the hearts in every state, food and the Hunger effect's food, armour, air bubbles, the mount's jump bar, the effect backgrounds and the beacon, bundle, crafter and enchanting table pieces. The boss bar, the hotbar, the item description box, and the icons and buttons Bedrock draws its own way stay Java only, and the build says so for each sprite, with the reason. Keep a sprite at the game's own size (a heart is 9 x 9) if Bedrock players should see it.
  • The fonts that draw a screen inside a title or the action bar are Java only: Bedrock draws every glyph at the text's size, so a Bedrock player gets such a screen in Bedrock's own form.
  • scaling says how a sprite is drawn larger than its picture: stretch (the default), tile with a width and height, or nine_slice with a width, a height and a border (one number, or left, top, right, bottom), which keeps a frame's corners and edges at any size.

Shaders and Bedrock fog

A shader override changes how the Java client draws, for example core/lightmap.fsh for darker light. Bedrock has no shaders. A Play Strawberry server sends your shader to Java 26.3 players once it is checked and the server's owner has approved it (steps below). Often what a shader is for is darkness and a short view, and Bedrock can show that as fog. Say so with bedrock_fog:

json
"shaders": [
  { "path": "core/lightmap.fsh", "file": "shaders/core/lightmap.fsh",
    "bedrock_fog": { "distance": 6, "colour": "#000000" } }
]
  • path is the shader's path under assets/minecraft/shaders/.
  • With bedrock_fog, Bedrock players see the view fade into colour and end distance blocks away (1 to 1024). Without it, the build says that Bedrock players see nothing of the shader.

Getting a shader to players

Write the shader for Java 26.3: #version 330, layout(location = N) on every in and out, and #include <minecraft:…> for the game's own include files. A shader that does not load would make every player's game reject the whole pack, so the server only sends one that passed a check.

  1. Upload your pack as you always do, and restart the server: it reads your pack when it starts.
  2. The server checks each shader the way the 26.3 game compiles it. The server's content page in the panel lists every shader file with its state: compiled, failed (with the game's message), or waiting for a test in your own game. A shader that includes a file your pack does not carry, such as the game's own minecraft: include files, can only be checked by a game.
  3. For such a shader, approve it first, then join the server with Strawberry Core as an operator. You get a test pack with the shader; your game loads it and tells the server whether it worked. The content page then shows it as verified in your game, or failed with the game's message.
  4. The server's owner approves each shader file on the content page. The approval is for that exact file on that server: a changed file needs a new approval, and another server never gets it. Once a shader is approved and has passed, the next pack carries it for every Java 26.3 player. Withdrawing the approval leaves it out of the next pack.

Players on another Java version get the same pack without the shader. To tint one player's view without a shader or a pack of your own, see the screen tint below.

A screen tint on both editions

player.set_screen_tint(color, strength) lays one colour over a player's whole view, on Java and on Bedrock alike. You need no pack of your own: the Strawberry pack that players get draws it, and only that player sees it.

rust
// Red at 40 %.
let _ = player.set_screen_tint(0xFF0000, 0.4);
// Take it off again.
player.clear_screen_tint();
  • Colour: 0xRRGGBB. It is shown as the nearest of 16 colours, so pick one of them to get exactly what you ask for: FF0000, FF8000, FFFF00, 80FF00, 00FF00, 00FF80, 00FFFF, 0080FF, 0000FF, 8000FF, FF00FF, FF0080, FFFFFF, 808080, 000000 and 800000.
  • Strength: a number from 0 to 1. A Java player sees it in tenths: it is rounded to the nearest tenth, so 0.44 shows as 0.4 and anything below 0.05 shows nothing. A Bedrock player sees the strength as you give it.
  • One tint per player: a new call replaces the tint, whichever script set it. clear_screen_tint takes off only a tint your script set, and your script's tints go when it is unloaded. get_screen_tint returns the colour and the strength as they were set, or nothing.
  • A colour above 0xFFFFFF or a strength outside 0 to 1 is refused with an error, and the player's tint stays as it was.
  • A player whose game does not have the Strawberry pack sees nothing; the call still succeeds.

Armour with its own look

A suit, a uniform, a set of armour drawn for your game: describe the look once in equipment, and say which items wear it.

json
"equipment": [
  { "name": "hazmat",
    "humanoid": "textures/hazmat_body.png",
    "humanoid_leggings": "textures/hazmat_legs.png" }
],
"items": [
  { "name": "hazmat_jacket", "base": "minecraft:leather_chestplate", "stack": 1, "file": "textures/hazmat_jacket.png",
    "names": { "en": "Hazmat Jacket", "fr": "Veste hazmat", "es": "Chaqueta hazmat", "tr": "Hazmat Ceketi" },
    "wear": { "slot": "chest", "equipment": "hazmat" } }
]
  • A look has one picture per layer, drawn like vanilla armour: humanoid (helmet, chestplate and boots) and humanoid_leggings, each 64 x 32 in the vanilla armour layout; wings (64 x 32, on the chest of an item that can glide), wolf_body (64 x 32), horse_body (64 x 64) and llama_body (128 x 64). Twice or four times those sizes gives more detail. A transparent pixel is not drawn, so a look can be smaller than vanilla armour.
  • "dyeable": {} lets a dyed item tint the look; "dyeable": { "undyed": "#A06540" } also gives the colour of an undyed item.
  • wear on an item names its slot (head, chest, legs, feet) and its look. Bedrock players see the look on that item too, drawn on the vanilla armour shape. Wings and animal armour are drawn for Java players only, and the build says so.
  • The look's id is <namespace>:<name>. The item that is worn needs the equippable component with that id; with the custom-models script you do not set it yourself: register the look with armour and give items with wear, and every item it hands out is worn with the look.
  • A hat, a mask or any head piece with its own 3D shape is an item model, not a look: an item worn on the head without a look is drawn there with its own model.

Fonts of your own

A picture inside a title, a HUD of your own, a boss bar with its own look, a map in the Tab list: each of these is a font in your Java pack, drawn by text the game shows anyway. Describe the fonts in fonts:

json
"fonts": {
  "images": [ { "name": "white", "file": "fonts/white.png" } ],
  "sheets": [ { "name": "digits", "file": "fonts/digits.png", "rows": ["0123456789"], "space": 3 } ],
  "places": [ { "image": "white", "top": -120 }, { "sheet": "digits", "top": 20 } ],
  "maps": [ { "name": "level0", "file": "maps/level0.png", "tile_width": 8, "tile_height": 8, "top": 0 } ]
}
  • An image is drawn at its own size: one pixel of the picture is one pixel of the game's interface. It is at most 256 pixels high and 512 wide; wider than 256, it is drawn as strips of equal width side by side.
  • A sheet is a grid of letters in one picture (at most 256 x 256, at most 512 letters). rows names the letter of each box, row by row, with a space for a box that is not a letter. space is the width of a space (1 to 32).
  • A place draws an image or a sheet at one height. top is how far below the top of the text line it starts, in pixels; a negative value is above the line, at most 512 either way. The same image at two heights needs two places. The game draws nothing higher above the line than its own height, so such a place is refused.
  • A map is a picture (at most 512 x 512) cut into tiles of tile_width x tile_height pixels (1 to 64, at most 4,096 tiles). Every tile is a character of the map's own font, and each row of tiles is drawn one tile lower than the row before. So the whole map is one line of text: a row of tiles, a move back to the left, the next row. To show only the places a player has seen, your script sends a move of the tile's width instead of the tile. A tile with no pixel at all has no character.

Every picture is a 32-bit RGBA PNG. The fonts are named after your namespace:

  • <namespace>:fonts/ui holds the images and the moves.
  • <namespace>:fonts/<sheet>_p<top> (_m<top> above the line) is each sheet at each height.
  • <namespace>:fonts/maps/<map> is each map, which has the moves too.

The build writes my-pack-fonts.json beside the zips. It holds what your script needs to lay out text to the pixel:

  • the character of each image and each tile, and how far the text moves after it (one past its last column with a pixel, plus one: a full 8-pixel tile moves it by 9);
  • the width of each sheet letter;
  • in moves, the characters that move the text right by 1, 2, 4 ... 1024 pixels, or left when their value is negative.

Read the file into your script when you build the script; it changes only when the fonts do.

Fonts reach Java players only. Bedrock draws every character at the size of the text, with no height of its own, so a Bedrock player sees none of them; give Bedrock players the same thing in Bedrock's own form, such as a form or a plain title. The build says so.

Biome colours on Bedrock

Java players see a data pack biome's sky, fog, water and plant colours from the biome file itself. Bedrock players get them from the Bedrock pack, so name each biome in the description with its file:

json
"biomes": [
  { "id": "my_pack:red_city", "file": "data/my_pack/worldgen/biome/red_city.json" }
]

The id is the biome's full name, the same one your chunk generator uses. The tool reads the colours from the file (#rrggbb or a whole number) and gives the Bedrock pack the biome's sky, fog, water fog, water, grass and foliage colours. A colour the biome does not set keeps Bedrock's default, and the build lists what each biome became. For dark_forest grass, Bedrock keeps its default grass colour.

Build

bash
strawberry-kit pack build pack/look.json

The tool writes my-pack-java.zip and my-pack-bedrock.zip into pack/dist (or the folder you name with --out <folder>). It prints what each file became, what changed since the last build, and each zip's size and SHA-1.

Beside the description it keeps look.record.json, the record of the last build. Keep it in your repository: it keeps the Bedrock pack's identity the same from build to build, and it is how the tool lists what changed. When the tool refuses a pack it prints every reason and writes nothing, not even the record.

The same description gives the same bytes on every computer, so you can build in CI and get the zips your players already have.

Put the pack on your server

One command puts both zips of your last build on your own server, and every player gets the pack of their edition when they join: see Your server's own pack. A Play Strawberry server hosts the files, and a script does not send resource packs itself.

Sounds: channels and loops

A sound with one channel (mono) is placed in the world on Java; a sound with two channels plays flat for the player. The pack report prints a warning: sound <name>: ... line when the number of channels and the sound's positional setting disagree, when a file has more than two channels, or when its header cannot be read. A warning never refuses the pack.

The build report prints the length of every sound in ticks and milliseconds. A Java client plays a sound once, so a script that wants a sound to go on replays it on the tick its length has passed. Give the file a half-second fade tail (fade in at the start, the same half second fading out after the end) so a replay a tick early or late overlaps instead of leaving a gap. The tool reports the length but does not write the tail.

Extra assets

A finished pack/assets folder you have, such as one made for your own script, can be built into your pack: list the folder under extra_assets in your description. Every file goes into the Java zip unchanged; Bedrock gets nothing from these files and the report says so. The build refuses folders outside your project, symbolic links, your own namespace, minecraft and paths another input also writes. A script such as the minimap puts its own files into your server's pack itself, so it needs no entry here.

On this page