nyubi_39211

마인크래프트 스타일의 낮은 폴리곤, 짧고 날카로운 얼음 단검. 빛나는 하늘색 코어를 가진 뾰족한 얼음 결정 조각들의 반투명 칼날. 어두운 서리 낀 손잡이. 64x64 픽셀 아트 텍스처로

Kodari AI
KodariAug 4 at 2:08 pm 1
FrostDagger
FrostDagger is a Minecraft plugin that adds a craftable ice dagger weapon with a translucent, sharp crystalline blade and a glowing sky-blue core. Players can craft the dagger using packed ice and a frost core material, and it deals bonus frost damage that slows enemies on hit. The plugin includes custom crafting recipes, a unique damage mechanic with slowness effects, and a particle effect trail when swinging. It also provides a configurable damage value, durability, and enchantability, making it a balanced early-to-mid game weapon option. The dagger's low-poly aesthetic is reflected in its custom model data and texture support.
  1. 리소스팩 메타데이터와 다이아몬드 검의 CustomModelData 오버라이드를 구성합니다.

  2. 반투명한 얼음 결정 칼날, 하늘색 코어, 어두운 서리 손잡이를 그리는 64×64 PNG 생성기를 추가합니다.

  3. 텍스처 생성 및 게임 내 지급 명령을 README에 정리합니다.

생성했습니다.

  • pack.mcmeta: 리소스팩 메타데이터

  • assets/minecraft/models/item/diamond_sword.json: CustomModelData:40601 오버라이드

  • assets/minecraft/models/item/ice_dagger.json: 얼음 단검 모델

  • tools/generate_ice_dagger_texture.py: 외부 이미지 라이브러리 없이 64×64 PNG 텍스처 생성

  • README.md: 설치 방법과 지급 명령

텍스처 생성 후:

Shell
python tools/generate_ice_dagger_texture.py

지급 명령:

Mcfunction
/give @s minecraft:diamond_sword{CustomModelData:40601,display:{Name:'{"text":"Ice Dagger","color":"aqua","italic":false}'}} 1
Kodari can make mistakes. Review important code before using.
Files
assets
tools
pack.mcmeta
README.md
Code
5 153
tools/generate_ice_dagger_texture.py
from pathlib import Path
import struct
import zlib


SIZE = 64
TRANSPARENT = (0, 0, 0, 0)


def create_canvas():
    return [[TRANSPARENT for _ in range(SIZE)] for _ in range(SIZE)]


def rectangle(canvas, left, top, right, bottom, color):
    for y in range(max(0, top), min(SIZE, bottom + 1)):
        for x in range(max(0, left), min(SIZE, right + 1)):
            canvas[y][x] = color


def polygon(canvas, points, color):
    min_x = max(0, min(x for x, _ in points))
    max_x = min(SIZE - 1, max(x for x, _ in points))
    min_y = max(0, min(y for _, y in points))
    max_y = min(SIZE - 1, max(y for _, y in points))

    for y in range(min_y, max_y + 1):
        for x in range(min_x, max_x + 1):
            inside = False
            previous = points[-1]
            for current in points:
                x1, y1 = previous
                x2, y2 = current
                if (y1 > y) != (y2 > y):
                    crossing = (x2 - x1) * (y - y1) / (y2 - y1) + x1
                    if x < crossing:
                        inside = not inside
                previous = current
            if inside:
                canvas[y][x] = color


def draw_texture():
    canvas = create_canvas()

    blade_shadow = (92, 172, 207, 155)
    blade = (158, 229, 249, 205)
    blade_light = (207, 248, 255, 235)
    blade_blue = (74, 190, 238, 220)
    core = (103, 232, 255, 255)
    core_light = (194, 250, 255, 255)
    frost_dark = (24, 55, 76, 255)
    handle = (31, 43, 57, 255)
    handle_light = (62, 81, 96, 255)
    guard = (20, 33, 47, 255)

    polygon(canvas, [(18, 45), (24, 37), (29, 32), (34, 25), (40, 17), (48, 7), (52, 4), (50, 13), (45, 23), (39, 31), (33, 39), (26, 47)], blade_shadow)
    polygon(canvas, [(23, 42), (28, 34), (34, 28), (38, 20), (45, 12), (50, 7), (47, 17), (42, 25), (36, 34), (30, 43)], blade)
    polygon(canvas, [(28, 37), (33, 29), (37, 22), (43, 15), (47, 11), (44, 21), (39, 29), (34, 37)], blade_light)
    polygon(canvas, [(30, 40), (34, 31), (39, 25), (44, 18), (41, 28), (36, 36)], blade_blue)

    polygon(canvas, [(27, 40), (31, 32), (36, 26), (40, 19), (43, 17), (39, 27), (34, 34), (31, 41)], core)
    rectangle(canvas, 34, 28, 36, 34, core_light)
    rectangle(canvas, 37, 23, 39, 27, core_light)
    rectangle(canvas, 31, 34, 33, 38, (75, 210, 249, 255))

    polygon(canvas, [(43, 16), (47, 10), (49, 8), (47, 17)], (231, 253, 255, 220))
    polygon(canvas, [(37, 28), (40, 22), (42, 21), (40, 29)], (237, 254, 255, 180))
    polygon(canvas, [(25, 42), (29, 37), (30, 41), (27, 45)], frost_dark)
    rectangle(canvas, 41, 14, 42, 18, (255, 255, 255, 210))
    rectangle(canvas, 35, 24, 36, 27, (255, 255, 255, 190))

    polygon(canvas, [(12, 49), (17, 43), (24, 36), (29, 40), (22, 47), (17, 53)], guard)
    rectangle(canvas, 15, 44, 25, 46, handle_light)
    rectangle(canvas, 13, 47, 20, 49, (48, 69, 83, 255))

    polygon(canvas, [(17, 48), (23, 41), (28, 44), (22, 52), (19, 56), (14, 53)], handle)
    polygon(canvas, [(19, 49), (23, 45), (25, 46), (21, 52), (18, 54)], handle_light)
    rectangle(canvas, 14, 52, 19, 55, frost_dark)
    rectangle(canvas, 16, 55, 20, 57, handle)
    polygon(canvas, [(13, 53), (17, 55), (20, 57), (18, 59), (13, 56), (11, 54)], guard)
    rectangle(canvas, 12, 54, 15, 55, (84, 112, 126, 255))

    return canvas


def write_png(path, canvas):
    raw = b"".join(b"\x00" + bytes(channel for pixel in row for channel in pixel) for row in canvas)

    def chunk(kind, data):
        return struct.pack(">I", len(data)) + kind + data + struct.pack(">I", zlib.crc32(kind + data) & 0xFFFFFFFF)

    png = b"\x89PNG\r\n\x1a\n"
    png += chunk(b"IHDR", struct.pack(">IIBBBBB", SIZE, SIZE, 8, 6, 0, 0, 0))
    png += chunk(b"IDAT", zlib.compress(raw, 9))
    png += chunk(b"IEND", b"")
    path.parent.mkdir(parents=True, exist_ok=True)
    path.write_bytes(png)


if __name__ == "__main__":
    output = Path(__file__).resolve().parents[1] / "assets/minecraft/textures/item/ice_dagger.png"
    write_png(output, draw_texture())
    print(f"Generated {output} ({SIZE}x{SIZE})")