"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”的漏洞在国际版中由漏洞追踪器维护,请在此报告漏洞。
你知道吗[编辑]
- 树苗成长为一棵树的瞬间其实是在原地放置了一个对应的树地物。
画廊[编辑]
-
一棵普通的橡树
-
一棵花俏的橡树
-
一棵倒下的白桦树
-
一棵金合欢树
-
拥有巨型树干和巨型树冠的丛林树
-
一棵巨型云杉树
-
一棵普通松树
-
拥有屋盖树冠的深色橡树
-
杜鹃花树使用随机传播树冠属性来同时拥有两种树叶方块