mc-java wiki

website·Indexed 29 days ago

https://wiki.mcjava.dev/

A technical wiki and guide for Minecraft: Java Edition resource packs. It provides tutorials on pack structure, JSON formatting, predicates, and default assets, as well as documentation on external programs like Blockbench, Gimp, and Visual Studio Code used in resource pack development.

Tokens
5.9K
Snippets
20
Records
49
Agent score
50%

What's inside mc-java wiki

  1. mcjava-wiki technical stack overview

    The mcjava-wiki is built using the following technology stack:

    • Content: Written in Markdown and MDX
    • Framework: Gatsby
    • Theme: Smooth Doc
    • Deployment: Cloudflare Pages
  2. Understand JSON syntax for Minecraft resource packs

    JSON (JavaScript Object Notation) is the standard hierarchical data format used for nearly all text-based resource pack entries in Minecraft. It consists of nested data types and follows strict syntax rules regarding commas and quotes.
  3. Understand the Java Edition resource pack directory structure

    Java Edition resource packs follow a specific folder hierarchy. The root of the pack must contain the assets folder, pack.mcmeta, and pack.png. When compressing the pack into a ZIP file, these items must be at the root level; compressing the enclosing folder instead of the contents will prevent the pack from loading.
    Root
    ┣ 📂assets
    ┃ ┣ 📂minecraft
    ┃ ┃ ┣ 📂blockstates
    ┃ ┃ ┣ 📂font
    ┃ ┃ ┣ 📂icons
    ┃ ┃ ┣ 📂lang
    ┃ ┃ ┣ 📂models
    ┃ ┃ ┃ ┣ 📂block
    ┃ ┃ ┃ ┗ 📂item
    ┃ ┃ ┣ 📂particles
    ┃ ┃ ┣ 📂resourcepacks
    ┃ ┃ ┣ 📂shaders
    ┃ ┃ ┃ ┣ 📂post
    ┃ ┃ ┃ ┗ 📂program
    ┃ ┃ ┣ 📂sounds
    ┃ ┃ ┣ 📂texts
    ┃ ┃ ┣ 📂textures
    ┃ ┃ ┗ 📜sounds.json
    ┣ 📜pack.mcmeta
    ┗ 📜pack.png
  4. Resolve model parentals for conversion

    Java models often use parentals to inherit textures, elements, and display settings. Before conversion, these must be resolved by traversing the parent chain until all required data is found:

    • Item Models: Resolve until the end of the chain or until elements, textures, and display settings are found.
    • Block Models: Resolve until elements and textures are found (display settings are irrelevant for blocks).

    Note: Texture lists should be stored in memory during this process to facilitate optimal texture atlas generation by identifying overlaps across models.

  5. Generate texture atlases for Bedrock item models

    Bedrock models implemented as entities via attachables can only use a single texture. Therefore, texture atlases must be generated for each item model to combine multiple textures into one.

    Constraints and Caveats:

    • Exclusions: Items using the minecraft:builtin/generated parent should be excluded from atlas generation because they do not support UV manipulation.
    • Block Models: For models used exclusively for blocks, using material instances is a viable alternative to atlas generation, especially when many block models share textures, to avoid instability caused by oversized atlases.
    • Performance: To ensure compatibility with low-spec devices (e.g., Nintendo Switch, mobile), generated atlases should ideally not exceed 4096 pixels in size.
  6. Find community support for Java resource pack development

    For advanced Java resource pack development, several community hubs provide specialized support:

    • mcjava-wiki Discord: Official server for the mcjava-wiki project; focuses on wiki contributions and general resource pack support.
    • Blockbench Discord: Official server for the Blockbench 3D modeling program; provides general resource pack help across multiple platforms.
    • Nullbox Discord: Specialized in voxel modeling for Minecraft: Java Edition, particularly useful for users of the Cubik tool.
    • Official Minecraft Discord: General support for Bedrock and Java packs, though high volume makes the search function the most effective way to find answers.
  7. Contribute to the mcjava-wiki using GitHub Desktop

    For ongoing contributions, GitHub Desktop is recommended. The workflow involves cloning the repository, forking it to your own account, and managing changes via branches.
    # Repository URL for cloning
    https://github.com/mcjava-wiki/mcjava-wiki
  8. Construct texture atlases for UV mapping

    When constructing atlases, minimize empty space to optimize memory. You must record the X and Y pixel coordinates and the original texture path for every texture placed on the atlas. This data is required to calculate and apply the correct UV shifts during the actual model conversion process.
  9. Extract main Minecraft assets from the game JAR on MacOS

    To extract the main assets folder from a specific Minecraft version on MacOS:

    1. In Finder, press Cmd + Shift + G and enter: ~/Library/Application Support/minecraft/versions.
    2. Select the folder of the version to be extracted.
    3. Right-click (or Ctrl + Click) the assets folder and select Services > New Terminal at Folder.
    4. Run the unzip command specifying the jar file and the assets path.
    5. Move the resulting assets folder to a safe location.
    unzip 1.15.jar 'assets/**/*'
  10. Preview mcjava-wiki changes locally

    To build and preview the site locally, you must have NodeJS installed. If you are using npm 7, you may need to use the --legacy-peer-deps flag during installation.
    git clone https://github.com/mcjava-wiki/mcjava-wiki
    cd mcjava-wiki
    npm install # Use 'npm install --legacy-peer-deps' if using npm 7
    npm run develop
  11. Extract main Minecraft assets from the game JAR on Linux

    To extract the main assets folder from a specific Minecraft version on Linux, use the command line to navigate to the version directory, unzip the assets from the jar, and move them to your target directory.
    cd ~/.minecraft/versions/1.16.5
    unzip 1.15.jar 'assets/**/*'
    mv assets [TARGET-DIRECTORY]