アドオン詳細解説 - ブロック(リソース)

アップロード:2023/01/01 最終更新:2023/01/01

アドオンのブロックについて説明します。

目次 (折りたたみ可)

テクスチャの変更

texturesフォルダのblocksフォルダの中に変えたいブロックのテクスチャを入れます。ファイル名はテンプレートを参照してください。

リソース
  ┣ manifest.json
  ┣ pack_icon.png
  ┗ textures
    ┗blocks
      ┗〇〇.png

ブロックのテクスチャの仕組み

terrain_texture.jsonでテクスチャにIDをつけ、blocks.jsonでそのIDとブロック本体を紐づけします。

terrain_texture.jsonの基本

ファイルの場所

textureフォルダの中に置きます。

リソース
  ┣ manifest.json
  ┣ pack_icon.png
  ┗ textures
    ┗terrain_texture.json

基本の構造

上の4行の値はコピペしたらそのままにしておいてください。

terrain_texture.json
{ "num_mip_levels": 4, "padding": 8, "resource_pack_name": "vanilla", "texture_name": "atlas.terrain", "texture_data": { "diamond_ore": { "textures": "textures/blocks/diamond_ore" } } }
{ "num_mip_levels": 4, "padding": 8, "resource_pack_name": "vanilla", "texture_name": "atlas.terrain", "texture_data": { ~#B(f00)"diamond_ore": { "textures": "textures/blocks/diamond_ore" }B#~ } }

上の例でdiamond_oreとなっているところは自分で決めるテクスチャのIDです。 アルファベット、アンダーバー( _ )、数字(1文字目以外)のみが使えます。
このIDのことをこのサイトでは「TerrainID」と呼ぶことがあります。

texturesの値はテクスチャのファイルパス(拡張子なし)です。

紐づけするブロックを増やす

赤枠で囲まれた部分を増やします。

terrain_texture.json
{ "num_mip_levels": 4, "padding": 8, "resource_pack_name": "vanilla", "texture_name": "atlas.terrain", "texture_data": { "diamond_ore": { "textures": "textures/blocks/diamond_ore" }, "gold_ore": { "textures": "textures/blocks/gold_ore" } } }
{ "num_mip_levels": 4, "padding": 8, "resource_pack_name": "vanilla", "texture_name": "atlas.terrain", "texture_data": { ~#B(f00)"diamond_ore": { "textures": "textures/blocks/diamond_ore" },B#~ ~#B(f00)"gold_ore": { "textures": "textures/blocks/gold_ore" }B#~ } }

カンマ( , )忘れに注意。

blocks.jsonの基本

ファイルの場所

manifest.jsonと同じ層に置きます。

リソース
  ┣ manifest.json
  ┣ pack_icon.png
  ┗ blocks.json

基本の構造

format_versionの値はコピペしたらそのままにしておいてください。

blocks.json
{ "format_version": [ 1, 1, 0 ], "diamond_ore": { "textures": "diamond_ore", "sound": "stone" } }
{ "format_version": [ 1, 1, 0 ], ~#B(f00)"~#M(83ffd9)diamond_oreM#~": { "textures": "diamond_ore", "sound": "stone" }B#~ }

マーカー部分は、紐づけるブロックのID(minecraft:は省略)、 texturesの値にはテクスチャのID(TerrainID)を指定します。

紐づけするブロックを増やす

赤枠で囲まれた部分を増やします。

blocks.json
{ "format_version": [ 1, 1, 0 ], "diamond_ore": { "textures": "diamond_ore", "sound": "stone" }, "gold_ore": { "textures": "gold_ore", "sound": "stone" } }
{ "format_version": [ 1, 1, 0 ], ~#B(f00)"diamond_ore": { "textures": "diamond_ore", "sound": "stone" },B#~ ~#B(f00)"gold_ore": { "textures": "gold_ore", "sound": "stone" }B#~ }

カンマ忘れに注意。

カスタムブロックにテクスチャを貼る

blocks.jsonでカスタムブロックのIDを指定します。

サウンドを指定する

blocks.jsonのsoundの値で指定できます。

サウンド一覧
概要
wood木材
stone
metal金属ブロック
glassガラス
grass草ブロック
gravel砂利
sand
scaffolding足場ブロック
amethyst_clusterアメジストの欠片
amethyst_blockアメジストブロック
large_amethyst_bud大きなアメジストの芽
big_dripleaf大きなドリップリーフ
frog_spawnカエルの卵
itemframe額縁
anvil金床
packed_mud乾燥した泥ブロック
fungusキノコ(ネザー)
stemキノコの茎(ネザー)
tuff凝灰岩
cave_vinesグロウベリーのツタ
basalt玄武岩
moss_carpet苔のカーペット
moss_block苔ブロック
ancient_debris古代のがれき
powder_snow粉雪
comparatorコンパレータ
coralサンゴブロック
shroomlightシュルームライト
pointed_dripstone鍾乳石
dripstone_block鍾乳石ブロック
sweet_berry_bushスイートベリーの茂み
sculkスカルク
sculk_catalystスカルクカタリスト
sculk_shriekerスカルクシュリーカー
sculk_sensorスカルクセンサー
sculk_veinスカルクのツタ
slimeスライムブロック
soul_sandソウルサンド
soul_soilソウルソイル
bamboo
bamboo_saplingたけのこ
small_amethyst_bud小さなアメジストの芽
chainチェーン
vinesツタ
azaleaツツジ
azalea_leavesツツジの葉
deepslateディープスレート
deepslate_bricksディープスレートレンガ
copper銅ブロック
muddy_mangrove_roots泥に使ったマングローブの根
mud泥ブロック
mud_bricks泥レンガ
nyliumナイリウム
roots根(ネザー)
dirt_with_roots根が張った土
nether_wartネザーウォート
nether_gold_oreネザー金鉱石
nether_sproutsネザースプラウト
netherrackネザーラック
nether_brickネザーレンガ
netheriteネザライトブロック
ladderハシゴ
honey_blockハチミツブロック
medium_amethyst_bud普通のアメジストの芽
hanging_rootsぶら下がる根
froglightフロッグライト
calcite方解石
spore_blossom胞子の花
bone_block骨ブロック
mangrove_rootsマングローブの根
snow
cloth羊毛
lanternランタン
candleロウソク
lodestoneロードストーン

面ごとに違うテクスチャ

blocks.jsonのtexturesを以下のように書くことで、面ごとに違うテクスチャを貼ることができます。

6面指定パターン

{ "textures": { "down": "crafting_table_bottom", // 下 "east": "crafting_table_side", // 東 "north": "crafting_table_front", // 北 "south": "crafting_table_front", // 南 "up": "crafting_table_top", // 上 "west": "crafting_table_side" // 西 }, "sound": "wood" }

上下・側面指定パターン

{ "textures": { "down": "log_top", // 下 "side": "log_side", // 側面 "up": "log_top" // 上 }, "sound": "wood" }

アニメーションするテクスチャ

texturesフォルダのflipbook_textures.jsonを作成・編集します。

ファイルの場所

リソース
  ┣ manifest.json
  ┣ pack_icon.png
  ┗ textures
    ┗ flipbook_textures.json

基本の構造

赤枠の部分を増やして他のブロックについて設定します。その際はカンマ忘れに注意。

flipbook_textures.json
[ { "flipbook_texture": "textures/blocks/water_still_grey", "atlas_tile": "still_water_grey", "ticks_per_frame": 2 } ]
[ ~#B(f00){ "flipbook_texture": "textures/blocks/water_still_grey", "atlas_tile": "still_water_grey", "ticks_per_frame": 2 }B#~ ]

flipbook_textureにテクスチャのファイルパス(拡張子なし)、 atlas_tileにテクスチャのID(TerrainID)を指定します。

ticks_per_frameで1コマ表示する長さ(tick)を指定できます。数が小さいほど速くなります。

その他のプロパティ

必要なときだけ追加するプロパティです。

atlas_index (int)

TerrainIDに含まれるテクスチャのインデックス。

atlas_tile_variant (int)

frames (int-n)

コマ番号を直接指定してコマの順番を決めます。

replicate (int)

ピクセルの大きさ。

blend_frames (bool)

falseにするとパッと次のコマへ遷移するように、 trueにするとスムーズにフェードしながら遷移するようになります。

テクスチャ

アニメーションのコマを1つずつ縦に並べたものを作ります。  1コマひとコマは必ず正方形なので、コマのサイズはテクスチャの横幅で決まります。

インベントリ内のテクスチャを別で指定

blocks.jsonのcarried_texturesプロパティを指定ことによって、 置いた状態のテクスチャと、手に持った(インベントリにある)状態でテクスチャを別にできます。

指定の方法はtexturesプロパティと同じでTerrainIDを指定し、面別指定も同様にできます。

{ "carried_textures": "bamboo_carried", "textures": "bamboo_sapling", "sound": "bamboo_sapling" }

テクスチャの向きをランダムにする

blocks.jsonでisotropicプロパティをtrueにすると、 ブロックを置いた座標によってテクスチャがランダムに回転(0°, 90°, 180°, 270°)します。面別指定できます。

{ "isotropic": true, "sound": "gravel", "textures": "clay" }

ランダムなテクスチャ

terrain_texture.jsonのtexturesvariationsで指定すると、 ブロックを置いた座標によってテクスチャがランダムになります。

{ "textures": { "variations": [ { "path": "textures/blocks/bookshelf0" }, { "path": "textures/blocks/bookshelf1" }, { "path": "textures/blocks/bookshelf2" }, { "path": "textures/blocks/bookshelf3" } ] } }

その他

複数のテクスチャを指定

{ "textures": [ "textures/blocks/anvil_top_damaged_0", "textures/blocks/anvil_top_damaged_1", "textures/blocks/anvil_top_damaged_2", "textures/blocks/anvil_base" ] }

brightness_gamma(blocks.json)

小数で指定。テクスチャの明るさ(ガンマ)を変えられる。

{ "brightness_gamma": 0.80, "sound": "nether_brick", "textures": "nether_brick" }

overlay_color(terrain_texture.json)

カラーコードで指定。テクスチャに単色をオーバーレイできます。

{ "textures": { "overlay_color": "#79c05a", "path": "textures/blocks/grass_side" } }

できないこと