"trunk": {
"trunk_height": <par1>,
"height_modifier": <par2>,
"can_be_submerged": {
"max_depth": <par3>
},
"can_be_submerged": <par4>,
"trunk_block": <par5>,
"trunk_decoration": {
"decoration_chance": <par6>,
"decoration_block": <par7>,
"num_steps": <par8>,
"step_direction": "<par9>"
}
}
- 致编者:请牢记我们的域名wiki.mcbe-dev.net!
- 致编者:欢迎加入本Wiki的官方交流QQ群或Discord服务器!
- 基岩版1.19.31现已发布!(了解更多)
- Inner Core现已支持Xbox模组联机!(了解更多)
- 如果您是第一次来到本Wiki,欢迎注册一个账户
- 点击顶部的“编辑”或“编辑源代码”按钮即可编辑当前页面
- 请知悉:在不登录时也可以编辑和新建页面,但是您当前的IP地址会记录在编辑历史中
手冊:minecraft:tree_feature
出自Minecraft基岩版开发Wiki
樹地物(Tree Feature)用於建構並生成一棵樹。
樹地物的屬性結構大致分為四部分:基本屬性、樹幹屬性、樹冠屬性和根部屬性,它們又由許多子屬性組成。
語法[編輯]
基本屬性[編輯]
"minecraft:tree_feature": {
"description": {
"identifier": "<par1>"
},
"base_block": <par2>,
"base_cluster": {
"may_replace": <par3>,
"num_clusters": <par4>,
"cluster_radius": <par5>
},
"may_grow_on": <par6>,
"may_replace": <par7>,
"may_grow_through": <par8>
//树干属性
//树冠属性
//根部属性
}
樹幹屬性[編輯]
樹冠屬性[編輯]
"canopy": {
"canopy_offset": {
"min": <par1>,
"max": <par2>
},
"min_width": <par3>,
"canopy_slope": {
"rise": <par4>,
"run": <par5>
},
"variation_chance": <par6>,
"leaf_block": <par7>,
"canopy_decoration": {
"decoration_chance": <par8>,
"decoration_block": <par9>,
"num_steps": <par10>,
"step_direction": "<par11>"
}
}
根部屬性[編輯]
"mangrove_roots": {
"max_root_width": <par1>,
"max_root_length": <par2>,
"root_block": <par3>,
"above_root": {
"above_root_chance": <par4>,
"above_root_block": <par5>
},
"muddy_root_block": <par6>,
"mud_block": <par7>,
"y_offset": <par8>,
"roots_may_grow_through": <par9>,
"root_decoration": {
"decoration_chance": <par10>,
"decoration_block": <par11>,
"num_steps": <par12>,
"step_direction": "<par13>"
}
}
結構[編輯]
- minecraft:tree_feature:根物件。
- *description:描述。
- *identifier:設定此地物的賦命名空間識別碼,其識別碼必須與檔案名匹配。
- base_block
- base_cluster
- may_replace
- *num_clusters:最小值為1。
- *cluster_radius:最小值為0。
- may_grow_on
- may_replace
- may_grow_through
- 一般樹幹屬性結構 參見Template:Nbt inherit/feature/trunk/template
- 相思木樹幹屬性結構 參見Template:Nbt inherit/feature/acacia_trunk/template
- 倒下的樹幹屬性結構 參見Template:Nbt inherit/feature/fallen_trunk/template
- 花俏的樹幹屬性結構 參見Template:Nbt inherit/feature/fancy_trunk/template
- 巨型樹幹屬性結構 參見Template:Nbt inherit/feature/mega_trunk/template
- 一般樹冠屬性結構 參見Template:Nbt inherit/feature/canopy/template
- 相思木樹冠屬性結構 參見Template:Nbt inherit/feature/acacia_canopy/template
- 花俏的樹冠屬性結構 參見Template:Nbt inherit/feature/fancy_canopy/template
- 巨型樹冠屬性結構 參見Template:Nbt inherit/feature/mega_canopy/template
- 巨型松樹樹冠屬性結構 參見Template:Nbt inherit/feature/mega_pine_canopy/template
- 松樹樹冠屬性結構 參見Template:Nbt inherit/feature/pine_canopy/template
- 屋蓋樹冠屬性結構 參見Template:Nbt inherit/feature/roofed_canopy/template
- 杉木樹冠屬性結構 參見Template:Nbt inherit/feature/spruce_canopy/template
- 隨機傳播樹冠屬性結構 參見Template:Nbt inherit/feature/random_spread_canopy/template
- *description:描述。
範例[編輯]
下面的範例將會建構出一顆花俏的橡木。
{
"format_version": "1.13.0",
"minecraft:tree_feature": {
"description": {
"identifier": "minecraft:fancy_oak_tree_feature"
},
"fancy_trunk": {
"trunk_height": {
"base": 5,
"variance": 12,
"scale": 0.618
},
"trunk_width": 1,
"trunk_block": {
"name": "minecraft:log",
"states": {
"old_log_type": "oak"
}
},
"branches": {
"slope": 0.381,
"density": 1.0,
"min_altitude_factor": 0.2
},
"width_scale": 1.0,
"foliage_altitude_factor": 0.3
},
"fancy_canopy": {
"height": 4,
"radius": 3,
"leaf_block": {
"name": "minecraft:leaves",
"states": {
"old_leaf_type": "oak"
}
}
},
"base_block": [
"minecraft:dirt",
{
"name": "minecraft:dirt",
"states": {
"dirt_type": "coarse"
}
}
],
"may_grow_on": [
"minecraft:dirt",
"minecraft:grass",
{
"name": "minecraft:dirt",
"states": {
"dirt_type": "coarse"
}
},
{
"name": "minecraft:farmland",
"states": {
"moisturized_amount": 0
}
},
{
"name": "minecraft:farmland",
"states": {
"moisturized_amount": 1
}
},
{
"name": "minecraft:farmland",
"states": {
"moisturized_amount": 2
}
},
{
"name": "minecraft:farmland",
"states": {
"moisturized_amount": 3
}
},
{
"name": "minecraft:farmland",
"states": {
"moisturized_amount": 4
}
},
{
"name": "minecraft:farmland",
"states": {
"moisturized_amount": 5
}
},
{
"name": "minecraft:farmland",
"states": {
"moisturized_amount": 6
}
},
{
"name": "minecraft:farmland",
"states": {
"moisturized_amount": 7
}
}
],
"may_replace": [
"minecraft:air",
{
"name": "minecraft:leaves",
"states": {
"old_leaf_type": "oak"
}
},
{
"name": "minecraft:leaves",
"states": {
"old_leaf_type": "spruce"
}
},
{
"name": "minecraft:leaves",
"states": {
"old_leaf_type": "birch"
}
},
{
"name": "minecraft:leaves",
"states": {
"old_leaf_type": "jungle"
}
},
{
"name": "minecraft:leaves2",
"states": {
"new_leaf_type": "acacia"
}
},
{
"name": "minecraft:leaves2",
"states": {
"new_leaf_type": "dark_oak"
}
}
],
"may_grow_through": [
"minecraft:dirt",
"minecraft:grass",
{
"name": "minecraft:dirt",
"states": {
"dirt_type": "coarse"
}
}
]
}
}
歷史[編輯]
基岩版 | |||||
---|---|---|---|---|---|
? | ? | 加入了minecraft:tree_feature。 | |||
1.19.0 | 1.19.0.20 | 新增了紅樹資料驅動介面。 |
錯誤[編輯]
關於「minecraft:tree_feature」的錯誤在國際版中由錯誤追蹤器維護,請在此回報錯誤。
你知道嗎[編輯]
- 樹苗成長為一棵樹的瞬間其實是在原地放置了一個對應的樹地物。
畫廊[編輯]
-
一棵普通的橡木
-
一棵花俏的橡木
-
一棵倒下的樺木
-
一棵相思木
-
擁有巨型樹幹和巨型樹冠的叢林木
-
一棵巨型杉木
-
一棵普通松樹
-
擁有屋蓋樹冠的黑橡木
-
杜鵑花樹使用隨機傳播樹冠屬性來同時擁有兩種樹葉方塊