Resource Pack

From Minicraft Wiki
Jump to navigation Jump to search
This article is about the current system to customize assets. For other uses, see Texture Pack (disambiguation).

The resource pack system is going to be changed with detailed structure.[Will be added in 2.2.0] With the current system, it is listed below.

The resource pack system provides a way for players to customize textures, sounds, languages, texts such as the credits, and fonts without any code modification.

Behaviour

Resource packs can be placed in the folder resourcepacks within the game directory. Each resource pack is a .zip file within the resourcepacks folder. Sub-folders are not supported.

Current Version

As in the current version Minicraft+, you can only apply one resource pack at once. In the options, you can choose one resource pack listed on the screen. Hot-adding is not supported.

2.2.0

In 2.2.0, you can apply multiple packs. Once in the folder, a resource pack can be added from the options, where resource packs can be moved between "Available resource packs" (Left-hand-side) and "Selected resource packs" (Right-hand-side). "Selected resource packs" also contain the default assets on the bottom, which cannot be removed.

Default resource packs

When playing the world, a default game resource pack appears as the default right above the default resource pack.

The old (before 2.2.0) textures are available in a resource pack titled "Classic Art". These textures are not updated when the game receives new textures.

Folder structure

Current Version

Resource packs use the following folder structure:
  • <root>
    • localization
      • <language>_<lang-tag>.json
    • sound (not implemented)
      • <sound name>.wav
    • textures

2.2.0

Resource packs use the following folder structure:
  • <root>
    • pack.json
    • pack.png
    • assets
      • books
        • <book>.txt
      • localization
        • <locale>.json
      • sound
        • <sound>.wav
      • textures
        • entity
          • <texture>.png
        • item
          • <texture>.png
        • tile
          • <texture>.png
        • gui
          • <texture>.png

Contents

The following content is available only after the 2.2.0 update.

A resource pack is identified by Minicraft based on the presence of the file pack.json in the root directory, which contains a JSON file with the following information:

  • <root> object
    • pack_format integer: Pack version. If this number does not match the current required number, the resource pack displays an error and requires additional confirmation to load the pack (only the pack greater than 0 has the ability to load with confirmation). See #Pack format for a full list of pack format numbers.
    • name string: The pack name. This is shown in the resource pack menu.
    • description string: Text shown below the pack name in the resource pack menu.
    • language object: Contains additional languages to add to the language menu.
      • object: Language code for a language, corresponding to a .json file with the same name in the folder assets/localization.
        • name string: The full name of the language.
        • region string: The country or region name.

The root directory also contains an optional image called pack.png, which appears on the top on the resource pack selection menu.

Pack format

The table below describes the version range using each pack format number:

Value Versions Changes compared to previous value
0 2.1.0-2.2.0-dev1 This format is simulated and treated as the format before the big update to the resource pack system. This is not supported since the update on 2.2.0-dev2.
1 2.2.0-dev2- -

Sounds

Resource packs load additional sounds with the file type of .wav. Each sound placed in the pack overrides the sounds from packs below.

Textures

For tile or item textures to function, they must have equal width and height (or height that is a multiple of the width if animated); otherwise, it appears as a magenta and black checkerboard. For most other textures, the file is stretched to fit the required dimensions. Also, the base dimensions should only be 8, or 16, or 24, depending on their corresponding textures.

If a file does not exist in any resource pack, including the default, the missing texture appears in its place.

For item textures, the required dimension of textures is fixed to 8. For tile and entity textures, it is fixed to 16, but for border textures, it is fixed to 24. The exceeded textures are cropped to fit the required dimensions.

Animation

Tile textures support animation by placing each additional frame below the last. The animation is then controlled using a .json file in JSON format with the same name and .png at the end of the filename, in the same directory. For example, the .json file for dirt.png would be dirt.png.json.

  • <root> object
    • animation object: Contains data for the animation.
      • frametime integer: Sets the default time for each frame in increments of one game tick.

If the .json file or the key does not exist in the pack and the texture does, the game assumes the texture is not animated, rather than loading a .json file from a pack below that pack.

Tile Border

This texture feature is exclusive to tile textures. These textures are used to show the "connections" the same or similar tiles near to them. This only affects the visual rendering effect. There are two textures related to tile "connections", border and corner. The dimensions of the border and corner textures are fixed to 16 and 24 respectively.

  • <root> object
    • border object: Contains data for the tile "connection" textures.
      • key string: The filename without the extension of the border texture.
      • corner string: The filename without the extension of the corner texture.

Texts

Five .txt files in UTF-8 format exist in assets/books. They are used by the game to determine the text to display.