テクスチャ編 part1.

公開日: 2025/08/19

テクスチャ以前に画像編集能力高くないから

warning

この記事にテクスチャ追加方法、変更方法について、直接の方法で記載されていません。
(間接的に書いてますが)

純粋にテクスチャ追加するなら、別記事か、日記さんの次回作にご期待ください。

本日の一言

Aviutl2 でましたね。 wine 経由で入れようとして失敗しました。
Aviutl 好きだったので、Aviutl2 もどうにかして使えるようにしたい。(wine で無理やりやるか、win 機買うか)

テクスチャ編集について

リソースパックとテクスチャパックと言う単語が入り混じってて、昔はテクスチャパックだったらしい。
この記事ではリソースパックに統一します。

ブロックの見た目を画像ファイルとして保存している。
一般的な 3D ゲームと異なり、一面分あればブロックテクスチャとして十分使える

形式は.png。 立体を表現する、モデルは.jsonで書かれている。

だいぶ単純な仕組みで動作してる。

画像ファイルのサイズについて

標準は16x16(pixel、以下単位は pixel)

重くなるのを覚悟の上、32x32、64x64...1024x1024 サイズと、高品質テクスチャにすることもできる。

編集ソフトについて

  • gimp
    でええやろ。画像編集は。(適当)
  • jar ファイルを解凍できるやつ(任意) 7zip とか。 最悪.jar.zipにすればいい。

そもそも本体のテクスチャってどこにある?

バニラランチャー使ってないので忘れた
client.jar参考

note

minecraft 本体のパス(multimc 系の場合)
<multimcのパス>/libraries/com/mojang/minecraft/<version>/minecraft-<version>-client.jar

jar ファイルを展開すると、中身は大量の.classファイルで埋め尽くされている。
ファイルブラウザのグループ化、シェルならcdと tab 連打で assets ディレクトリを探そう

assets 以降のパスについて

1.21.3 の場合(tree コマンドの結果)

assets/minecraft/以降で表示

.
├── atlases
├── blockstates
├── font
│   └── include
├── lang
├── models
│   ├── block
│   ├── equipment
│   └── item
├── particles
├── post_effect
├── shaders
│   ├── core
│   ├── include
│   └── post
├── texts
└── textures
    ├── block
    ├── colormap
    ├── effect
    ├── entity
    │   ├── allay
    │   ├── armorstand
    │   ├── axolotl
    │   ├── banner
    │   ├── bear
    │   ├── bed
    │   ├── bee
    │   ├── bell
    │   ├── boat
    │   ├── breeze
    │   ├── camel
    │   ├── cat
    │   ├── chest
    │   ├── chest_boat
    │   ├── conduit
    │   ├── cow
    │   ├── creaking
    │   ├── creeper
    │   ├── decorated_pot
    │   ├── end_crystal
    │   ├── enderdragon
    │   ├── enderman
    │   ├── equipment
    │   │   ├── horse_body
    │   │   ├── humanoid
    │   │   ├── humanoid_leggings
    │   │   ├── llama_body
    │   │   ├── wings
    │   │   └── wolf_body
    │   ├── fish
    │   ├── fox
    │   ├── frog
    │   ├── ghast
    │   ├── goat
    │   ├── hoglin
    │   ├── horse
    │   ├── illager
    │   ├── iron_golem
    │   ├── llama
    │   ├── panda
    │   ├── parrot
    │   ├── pig
    │   ├── piglin
    │   ├── player
    │   │   ├── slim
    │   │   └── wide
    │   ├── projectiles
    │   ├── rabbit
    │   ├── sheep
    │   ├── shield
    │   ├── shulker
    │   ├── signs
    │   │   └── hanging
    │   ├── skeleton
    │   ├── slime
    │   ├── sniffer
    │   ├── spider
    │   ├── squid
    │   ├── strider
    │   ├── tadpole
    │   ├── turtle
    │   ├── villager
    │   │   ├── profession
    │   │   ├── profession_level
    │   │   └── type
    │   ├── warden
    │   ├── wither
    │   ├── wolf
    │   ├── zombie
    │   └── zombie_villager
    │       ├── profession
    │       ├── profession_level
    │       └── type
    ├── environment
    ├── font
    ├── gui
    │   ├── advancements
    │   │   └── backgrounds
    │   ├── container
    │   │   └── creative_inventory
    │   ├── hanging_signs
    │   ├── presets
    │   ├── realms
    │   ├── sprites
    │   │   ├── advancements
    │   │   ├── boss_bar
    │   │   ├── container
    │   │   │   ├── anvil
    │   │   │   ├── beacon
    │   │   │   ├── blast_furnace
    │   │   │   ├── brewing_stand
    │   │   │   ├── bundle
    │   │   │   ├── cartography_table
    │   │   │   ├── crafter
    │   │   │   ├── creative_inventory
    │   │   │   ├── enchanting_table
    │   │   │   ├── furnace
    │   │   │   ├── grindstone
    │   │   │   ├── horse
    │   │   │   ├── inventory
    │   │   │   ├── loom
    │   │   │   ├── smithing
    │   │   │   ├── smoker
    │   │   │   ├── stonecutter
    │   │   │   └── villager
    │   │   ├── gamemode_switcher
    │   │   ├── hud
    │   │   │   └── heart
    │   │   ├── icon
    │   │   ├── notification
    │   │   ├── pending_invite
    │   │   ├── player_list
    │   │   ├── popup
    │   │   ├── realm_status
    │   │   ├── recipe_book
    │   │   ├── server_list
    │   │   ├── social_interactions
    │   │   ├── spectator
    │   │   ├── statistics
    │   │   ├── toast
    │   │   ├── tooltip
    │   │   ├── transferable_list
    │   │   ├── widget
    │   │   └── world_list
    │   └── title
    │       └── background
    ├── item
    ├── map
    │   └── decorations
    ├── misc
    ├── mob_effect
    ├── painting
    ├── particle
    └── trims
        ├── color_palettes
        ├── entity
        │   ├── humanoid
        │   └── humanoid_leggings
        └── items

名前空間について

assets/<名前空間>となってる。
mod が入れば、ここが変わる。

note

mod のテクスチャを変えたい時(かなりレアなケースだが)は、この名前空間の部分を ModID に置き換えれば Ok。
詳しくはfabric の記事参考

音楽がない

この中に見つからないものは、著作権などの関係上(?)別のファイルに設置されている模様。

models を見てみる

block なら、models/blockである。 アイテムなら、models/itemである。

tip

アイテムもモデルあります
平面モデルというのがありまして

assets/minecraft/models/block/stone.json

{
  "parent": "minecraft:block/cube_all",
  "textures": {
    "all": "minecraft:block/stone"
  }
}

王道の石モデル。 モデルと言いながらものすごくシンプルである。
parent(直訳は「親」)にも model が指定されている。 これを探してみよう。

assets/minecraft/models/block/cube_all.json

{
  "parent": "block/cube",
  "textures": {
    "particle": "#all",
    "down": "#all",
    "up": "#all",
    "north": "#all",
    "east": "#all",
    "south": "#all",
    "west": "#all"
  }
}

何とこちらもシンプルだった。

assets/minecraft/models/block/cube_all.json

{
  "parent": "block/block",
  "elements": [
    {
      "from": [0, 0, 0],
      "to": [16, 16, 16],
      "faces": {
        "down": { "texture": "#down", "cullface": "down" },
        "up": { "texture": "#up", "cullface": "up" },
        "north": { "texture": "#north", "cullface": "north" },
        "south": { "texture": "#south", "cullface": "south" },
        "west": { "texture": "#west", "cullface": "west" },
        "east": { "texture": "#east", "cullface": "east" }
      }
    }
  ]
}

少し細かくなった。
モデルは 1 ブロック 16 ドットあり、ドット単位で操作可能。
テクスチャは 32x32 と細かくできるが、モデルは 16 より細かくできない

assets/minecraft/models/block/cube_all.json

{
  "gui_light": "side",
  "display": {
    "gui": {
      "rotation": [30, 225, 0],
      "translation": [0, 0, 0],
      "scale": [0.625, 0.625, 0.625]
    },
    "ground": {
      "rotation": [0, 0, 0],
      "translation": [0, 3, 0],
      "scale": [0.25, 0.25, 0.25]
    },
    "fixed": {
      "rotation": [0, 0, 0],
      "translation": [0, 0, 0],
      "scale": [0.5, 0.5, 0.5]
    },
    "thirdperson_righthand": {
      "rotation": [75, 45, 0],
      "translation": [0, 2.5, 0],
      "scale": [0.375, 0.375, 0.375]
    },
    "firstperson_righthand": {
      "rotation": [0, 45, 0],
      "translation": [0, 0, 0],
      "scale": [0.4, 0.4, 0.4]
    },
    "firstperson_lefthand": {
      "rotation": [0, 225, 0],
      "translation": [0, 0, 0],
      "scale": [0.4, 0.4, 0.4]
    }
  }
}

ここでは手に持った時のモデルなどを指定している模様。

と、json ファイル内部で変数が使用できたり、親を指定して継承できたりと高機能である。
一方でかなりシンプルに作られているのもわかる。

石のように全方面同じテクスチャならcube_allを使えば良い。

texture を見てみる

model が cube_all だったので、石のテクスチャは一面で済まされている。

lang を見てみる

ここも json 形式。

{
  "minecraft:stone": "石ブロック"
}

みたいな形で指定できるらしい。

落とし穴

  • blockstates の指定がない
    fabric 記事見ていただいた方はわかるかと。
  • pack.mcmetaがない
    これがないとリソースパックとして認識されない。次回説明。
  • itemblockや名前空間(mod の場合)の指定ミス
    minecraft:cube_allは mod 制作でブロック追加する時も頻繁に使用するので、名前空間が混在する。

まとめ

最初見た時は驚いた。 .objファイルとかあると思ってたので。