icecordisback

Develop a Minecraft resource pack that replaces weapon textures using the provided PNG images. Ensure the pack is compatible with the latest Minecraft version, includes a clear folder structure, and offers an easy installation guide. Additionally, implement variations for different weapon types (swords, bows, axes) to enhance the overall aesthetic.

--- πŸ“Ž Attached 1 file(s):

File: pasted-code-1789194704424.txt

txt
Copy and paste this prompt directly into ChatGPT:

**System Role & Technical Requirement:** You are an expert Minecraft Java Edition resource pack developer. Your task is to generate a fully functioning, syntactically valid resource pack structured for Minecraft 1.21+.

Since you cannot directly stream a `.zip` archive binary, you must generate the complete directory tree and every file's exact contents in raw code blocks so I can save them, as well as python script code to compile them into a `.zip` automatically.

**Task Specifications:**

1. **Directory Structure:** Include `pack.mcmeta`, an assets folder with appropriate paths (`assets/minecraft/textures/item/` and `assets/minecraft/models/item/`), and a custom item JSON.
2. **Base Item:** Use base items of 5 weapons given by mein previous chat as the target base item.
3. **Custom Model Data:** Configure `pack_format: 15` (or latest) in `pack.mcmeta`. In, implement an `overrides` array mapping `CustomModelData` values **1001, 1002, 1003, 1004, and 1005** to five distinct custom model files (`custom_item_1` through `custom_item_5`).
4. **Individual Model Files:** Write out the full JSON structure for each of the 5 custom model files using `item/generated` parent models and custom texture definitions.
5. **Python Auto-Zipper Script:** At the end of your response, provide a complete, executable Python script that automatically creates all these folders, writes the JSON files with the correct indentation, generates placeholder PNG textures, and compresses everything into a ready-to-use `CustomModelData_Pack.zip` file.

Do not skip any file contents or use placeholders like `// rest of code here`. Write out every JSON file completely.
1 image attached
Kodari AI
KodariSep 12 at 6:32 am 7
WeaponTexturePack
A Minecraft 1.21+ resource pack that replaces weapon textures with custom PNG images. Features a complete folder structure with pack.mcmeta, custom model data overrides for five weapon types (swords, bows, axes), and individual JSON model files. Includes a Python auto-zipper script that generates the full directory tree, writes all JSON configuration files, creates placeholder textures, and compiles everything into a ready-to-install CustomModelData_Pack.zip file for easy deployment.

Creating a 1.21.4+ weapon-variation resource pack with five Custom Model Data mappings, source-image cropping, and an installation guide.

Created the 1.21.4+ Arcane Weapon Variations resource-pack source, including:

  • Five Custom Model Data variations for swords, bow, and axes (1001–1005)

  • Modern range_dispatch item definitions for latest Minecraft item models

  • Individual generated-item model JSON files

  • Python builder that crops the supplied weapon sheet into textures, creates pack.png, and outputs Arcane_Weapon_Variations.zip

  • Fallback generated textures when source/weapons.png is unavailable

  • Complete build, installation, and /give command guide in README.md

Kodari can make mistakes. Review important code before using.
Files
pack
build_pack.py
README.md
requirements.txt
Code
14 325
build_pack.py
from pathlib import Path
import shutil
import zipfile

from PIL import Image, ImageDraw


PROJECT_ROOT = Path(__file__).resolve().parent
PACK_SOURCE = PROJECT_ROOT / "pack"
SOURCE_IMAGE = PROJECT_ROOT / "source" / "weapons.png"
BUILD_DIRECTORY = PROJECT_ROOT / "build" / "Arcane_Weapon_Variations"
ZIP_FILE = PROJECT_ROOT / "Arcane_Weapon_Variations.zip"
TEXTURE_DIRECTORY = BUILD_DIRECTORY / "assets" / "minecraft" / "textures" / "item"

TEXTURE_CROPS = {
    "custom_item_1": (5, 5, 507, 508),
    "custom_item_2": (519, 5, 1020, 508),
    "custom_item_3": (1032, 5, 1534, 508),
    "custom_item_4": (241, 521, 765, 1018),
    "custom_item_5": (777, 521, 1269, 1018),
}

PLACEHOLDER_COLORS = {
    "custom_item_1": (255, 84, 20, 255),
    "custom_item_2": (30, 177, 255, 255),
    "custom_item_3": (98, 219, 255, 255),
    "custom_item_4": (221, 36, 57, 255),
    "custom_item_5": (143, 50, 255, 255),
}


def create_placeholder(texture_name: str) -> Image.Image:
    image = Image.new("RGBA", (128, 128), (0, 0, 0, 0))
    draw = ImageDraw.Draw(image)
    color = PLACEHOLDER_COLORS[texture_name]
    outline = (30, 30, 40, 255)

    if texture_name in {"custom_item_1", "custom_item_3"}:
        draw.polygon([(20, 110), (42, 110), (110, 22), (92, 12)], fill=outline)
        draw.polygon([(31, 105), (43, 105), (103, 25), (91, 21)], fill=color)
        draw.rectangle((16, 96, 45, 108), fill=outline)
        draw.rectangle((20, 98, 40, 105), fill=color)
    elif texture_name == "custom_item_2":
        draw.arc((18, 10, 112, 116), 280, 80, fill=outline, width=13)
        draw.arc((18, 10, 112, 116), 280, 80, fill=color, width=7)
        draw.line((31, 95, 104, 32), fill=outline, width=6)
        draw.line((34, 91, 100, 35), fill=(220, 245, 255, 255), width=2)
    else:
        draw.line((25, 111, 91, 45), fill=outline, width=18)
        draw.line((27, 109, 87, 49), fill=color, width=10)
        draw.polygon([(67, 16), (116, 22), (111, 70), (76, 80)], fill=outline)
        draw.polygon([(74, 23), (108, 28), (104, 62), (80, 70)], fill=color)

    return image


def create_texture(texture_name: str, source: Image.Image | None) -> None:
    destination = TEXTURE_DIRECTORY / f"{texture_name}.png"
    if source is None:
        texture = create_placeholder(texture_name)
    else:
        texture = source.crop(TEXTURE_CROPS[texture_name]).convert("RGBA")
        texture.thumbnail((256, 256), Image.Resampling.LANCZOS)
        canvas = Image.new("RGBA", (256, 256), (0, 0, 0, 0))
        position = ((256 - texture.width) // 2, (256 - texture.height) // 2)
        canvas.alpha_composite(texture, position)
        texture = canvas
    texture.save(destination, "PNG")


def create_pack_icon(source: Image.Image | None) -> None:
    destination = BUILD_DIRECTORY / "pack.png"
    if source is None:
        icon = create_placeholder("custom_item_1")
    else:
        icon = source.crop(TEXTURE_CROPS["custom_item_1"]).convert("RGBA")
        icon.thumbnail((128, 128), Image.Resampling.LANCZOS)
    icon.save(destination, "PNG")


def write_zip() -> None:
    if ZIP_FILE.exists():
        ZIP_FILE.unlink()
    with zipfile.ZipFile(ZIP_FILE, "w", zipfile.ZIP_DEFLATED) as archive:
        for path in BUILD_DIRECTORY.rglob("*"):
            if path.is_file():
                archive.write(path, path.relative_to(BUILD_DIRECTORY))


def main() -> None:
    if BUILD_DIRECTORY.exists():
        shutil.rmtree(BUILD_DIRECTORY)
    shutil.copytree(PACK_SOURCE, BUILD_DIRECTORY)
    TEXTURE_DIRECTORY.mkdir(parents=True, exist_ok=True)

    source = Image.open(SOURCE_IMAGE).convert("RGBA") if SOURCE_IMAGE.exists() else None
    for texture_name in TEXTURE_CROPS:
        create_texture(texture_name, source)
    create_pack_icon(source)
    write_zip()

    source_status = "cropped the supplied weapon sheet" if source else "generated fallback placeholder textures"
    print(f"Created {ZIP_FILE.name} and {source_status}.")


if __name__ == "__main__":
    main()