uploaded:2020/4/19 engine version:1.14.0.9

BlockStatesの正体


 長い間、リファレンスに載っているのに利用の方法が全くわからないのは歯がゆいものでした。もしかしたらとても有能で、使えたら一気にできることが増えるかもしれないのに、知らずに放置するのはかなりもったいないです。
 そして今回は謎が解けたので紹介していきたいと思います。

 BlockStatesもといブロックステートとは、データ値をタグのように扱うものだったのです。バイオームやフィーチャーの作り方の記事に詳しい使い方を説明を載せるので、今回はどんなプロパティがあるかのリファレンスということにします。
基本的にはこのような形をとります。


{
  "name": str,
  "states": {
    "": str,
    "": int,
    ...
  }
}
nameはブロックのアイデンティファイア、statesの中身はそれぞれブロックによって決まったプロパティと値の組が入ります。

■ minecraft:stone

状態データ値stone_type
0
花崗岩1granite
磨かれた花崗岩2granite_smooth
閃緑岩3diorite
磨かれた閃緑岩4diorite_smooth
安山岩5andesite
磨かれた安山岩6andesite_smooth

これで閃緑岩を指定したいのであれば、こう書きます:
{
  "name": "minecraft:stone",
  "states": {
    "stone_type": "diorite"
  }
}
以降同じような書き方、表との照らし合わせ方をします。

■ minecraft:dirt

状態データ値dirt_type
0
粗い土1coarsed

■ minecraft:planks / minecraft:wood / minecraft:wooden_slab / minecraft:fence

状態データ値wood_type
0oak
トウヒ1sprace
2birch
ジャングル3jungle
アカシア4acacia
黒樫5dark_oak

■ minecraft:sand

状態データ値sand_type
0
赤砂1red

■ minecraft:sponge

状態データ値sponge_type
スポンジ0dry
ぬれたスポンジ1wet

■ minecraft:sandstone / minecraft:red_sandstone

状態データ値sand_stone_type
砂岩0default
模様入り砂岩1heiroglyphs
カットされた砂岩2cut
なめらか砂岩3smooth

■ minecraft:wool / (色系のものはだいたいすべて)

状態データ値color
0white
オレンジ1orange
赤紫2magenta
空色3light_blue
黄色4yellow
黄緑5lime
ピンク6pink
灰色7gray
薄灰色8light_gray
水色9cyan
10purple
11blue
12brown
13green
14red
15black

■ minecraft:stone_slab

状態データ値stone_slab_type
なめらか石0smooth_stone
砂岩1sandstone
石(見た目は樫)2wood
丸石3cobblestone
レンガ4brick
石レンガ5stone_brick
クォーツ6quartz
ネザーレンガ7nether_brick

◎top_slot_bit(bool)

上付きかどうか。データ値8から15は上付きとなり、このプロパティがtrueになります。

■ minecraft:stone_slab2

状態データ値stone_slab_type_2
赤砂岩0red_sandstone
プルプァ1purpur
プリズマリン2prismarine_rough
ダークプリズマリン3prismarine_dark
プリズマリンレンガ4prismarine_brick
苔むした丸石5mossy_cobblestone
なめらか砂岩6smooth_sandstone
赤いネザーレンガ7red_nether_brick

◎top_slot_bit(bool)

上付きかどうか。データ値8から15は上付きとなり、このプロパティがtrueになります。

■ minecraft:stone_slab3

状態データ値stone_slab_type_3
エンドストーンレンガ0endstone_brick
なめらか赤砂岩1smooth_red_sandstone
磨かれた安山岩2polished_andesite
安山岩3andesite
閃緑岩4diorite
磨かれた閃緑岩5polished_diorite
花崗岩6granite
磨かれた花崗岩7polished_granite

◎top_slot_bit(bool)

上付きかどうか。データ値8から15は上付きとなり、このプロパティがtrueになります。

■ minecraft:stone_slab4

状態データ値stone_slab_type_4
苔むした石レンガ0mossy_stone_brick
なめらかクォーツ1smooth_quartz

◎top_slot_bit(bool)

上付きかどうか。データ値8から15は上付きとなり、このプロパティがtrueになります。

■ minecraft:cobblestone_wall

状態データ値wall_block_type
丸石0cobblestone
苔むした丸石1mossy_cobblestone
花崗岩2granite
閃緑岩3diorite
安山岩4andesite
砂岩5sandstone
レンガ6brick
石レンガ7stone_brick
苔むした石レンガ8mossy_stone_brick
ネザーレンガ9nether_brick
エンドストーンレンガ10end_brick
プリズマリン11prismarine
赤砂岩12red_sand_stone
赤いネザーレンガ13red_nether_brick

◎wall_connection_type_east(str):none

◎wall_connection_type_north(str):none

◎wall_connection_type_south(str):none

◎wall_connection_type_west(str):none

■ minecraft:anvil

状態データ値damage
0undamaged
少し壊れた4slightly_damaged
かなり壊れた8very_damaged

◎direction(int)

向き。値はデータ値がもとになってると思います。

■ minecraft:stone_brick

状態データ値stone_brick_type
 0default
苔むした1mossy
ひび割れた2cracked
模様入り3chiseled

■ minecraft:quartz_block

状態データ値chisel_type
 0default
苔むした1lines
ひび割れた2chiseled
模様入り3smooth

◎pillar_axis(str)

軸の向き。値はx,y,z,unknownのいずれかだと思います。

■ minecraft:prismarine

状態データ値prismarine_block_type
 0default
ダーク1dark
レンガ2bricks

■ minecraft:coral_block / minecraft:coral / minecraft:coral_fan / minecraft:coral_fan_dead

状態データ値coral_color
0blue
ピンク1pink
2purple
3red
黄色4yellow

◎dead_bit(bool)

死んでいるかどうか。8から12はtrueになります。coral_fanとcoral_fan_deadにはこのプロパティはありません。

■ minecraft:tallgrass

状態データ値tall_grass_type
 0
1tall
シダ2fern

■ minecraft:red_flower

状態データ値flower_type
ポピー0poppy
ヒスイラン1orchid
アリウム2allium
ヒナソウ3noustonia
赤いチューリップ4turip_red
オレンジのチューリップ5turip_orange
白いチューリップ6turip_white
ピンクのチューリップ7turip_pink
フランスギク8oxeye
ヤグルマギク9cornflower
スズラン10lily_of_the_valley

■ minecraft:spawn_egg

状態データ値spawn_egg_stone_type
0stone
丸石1cobblestone
石レンガ2stone_brick
苔むした石レンガ3mossy_stone_brick
ひび割れた石レンガ4cracked_stone_brick
模様付き石レンガ5chiseled_stone_brick

■ minecraft:double_plant

状態データ値double_plant_type
ヒマワリ0sun_flower
ライラック1syringa
2grass
シダ3fern
バラ4rose
ボタン5paeonia

■ minecraft:brown_mushroom_block / minecraft:red_mushroom_block

◎huge_mushroom_bits(int)

どの面をはげさせるか。データ値がもとになっていると思います。

■ minecraft:end_portal_frame

◎direction(int)

向き。データ値がもとになっていると思います。

◎end_portal_eye_bit(bool)

エンダーアイがはまっているかどうか。

■ minecraft:grindstone

◎attachment(str):standing

◎direction(int)

向き。データ値がもとになっていると思います。

■ minecraft:lantern

◎hanging(bool)

ぶら下がっているかどうか。

■ minecraft:piston / minecraft:ladder / minecraft:end_rod

◎facing_direction(int)

向き。データ値がもとになっていると思います。

■ minecraft:vine

◎vine_direction_bits(int)

向き。データ値がもとになっていると思います。

■ minecraft:snow

◎covered_bit(bool)

◎height(int)

高さ。おそらく9以上はなさそうです。

■ minecraft:respawn_anchor

◎respawn_anchor_charge(int)

チャージの量。おそらく5以上はなさそうです。

■ minecraft:beehive / minecraft:bee_nest

◎facing_direction(int)

向き。データ値がもとになっていると思います。

◎honey_lvel(int)

はちみつの量。

■ minecraft:log

◎old_log_type(str)

木の種類。木材と値は同じだと思います。

◎pillar_axis(str)

軸の向き。データ値がもとになっていると思います。

■ minecraft:wooden_button / (その他ボタン)

◎facing_direction(int)

向き。データ値がもとになっていると思います。

◎button_pressed_bit(bool)

ボタンが押されているかどうか。

■ minecraft:trapdoor

◎direction(int)

向き。データ値がもとになっていると思います。

◎open_bit(bool)

開いているかどうか。

◎upside_down_bit(bool)

逆さかどうか。正直どっちが上なのかわからないです。

■ minecraft:scaffolding

◎stability(int)

◎stability_check(bool)

■ minecraft:rail

◎rail_direction(int)

向き。データ値がもとになっていると思います。

■ minecraft:golden_rail

◎rail_direction(int)

向き。データ値がもとになっていると思います。

◎rail_data_bit(bool)

■ minecraft:torch / minecraft:redstone_torch

◎torch_facing_direction(str)

向き。データ値がもとになっていると思います。これはunknownしか値を知りません。

■ minecraft:chorus_flower / minecraft:fire / minecraft:blue_fire

◎age(int)

■ minecraft:leaves

◎old_leaf_type(str)

葉っぱの種類。logと同じ値だと思います。

◎persistent_bit(bool)

◎update_bit(bool)

■ minecraft:lectern

◎direction(int)

向き。データ値がもとになっていると思います。

◎powered_bit(bool)

■ minecraft:lever

◎lever_direction(str)

向き。クリエイティブインベントリから取り出したのはdown_east_westでした。

◎open_bit(bool)

■ minecraft:toripwire_fook

◎direction(int)

向き。データ値がもとになっていると思います。

◎attached_bit(bool)

◎powered_bit(bool)

■ minecraft:saylight_detector

◎redstone_signal(int)





これがすべてではないはずです。ここに書いてないもの、書いてあっても不十分だったりします。

値やプロパティ名を知る方法

知りたいブロックをインベントリに格納した状態でワールドを抜けてセーブをし、Androidにしか使えないアプリ「Blocktopograph」を使ってそのブロックのデータを見ると、下の画像のように載っていると思います。

そしてこのブロックステートはScriptingAPIでも使うことができるので、ScriptingAPIを用いて抽出する方法もあります。(どちらかと言えばこっちのほうが確実です)
written by: Masec Rinca