2.6
This commit is contained in:
36
docs/mconline/15-玩法组件教程/15-自定义特征和特征规则/8-了解序列特征规则.md
Normal file
36
docs/mconline/15-玩法组件教程/15-自定义特征和特征规则/8-了解序列特征规则.md
Normal file
@@ -0,0 +1,36 @@
|
||||
---
|
||||
front: https://nie.res.netease.com/r/pic/20211104/69055361-2e7a-452f-8b1a-f23e1262a03a.jpg
|
||||
hard: 高级
|
||||
time: 10分钟
|
||||
---
|
||||
|
||||
# 了解序列特征规则
|
||||
|
||||
在本节中,我们使用序列特征将上一节中的苹果挂在橡树上。
|
||||
|
||||
## 使用序列规则连接苹果特征
|
||||
|
||||
我们新建`oak_tree_then_apple_feature.json`文件:
|
||||
|
||||
```json
|
||||
{
|
||||
"format_version": "1.13.0",
|
||||
"minecraft:sequence_feature": {
|
||||
"description": {
|
||||
"identifier": "tutorial_demo:oak_tree_then_apple_feature"
|
||||
},
|
||||
"features": [
|
||||
"minecraft:oak_tree_feature",
|
||||
"tutorial_demo:apple_search_feature"
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
序列特征的放置列表中的特征的放置顺序是固定的,从列表中第一个特征放置到最后一个,同时上一个特征的输出位置会变成下一个特征的输入位置。树特征的输出位置在树顶,所以我们的苹果搜索特征才需要从上到下搜索,否则将搜索不到满足的位置。
|
||||
|
||||
和聚合特征不同,序列特征需要列表中全部特征都完成放置才会判定成功,而如果中途某个特征放置失败则整个特征都会被判定为失败。不过,列表中已放置的特征不会消失,但是失败特征之后的特征将全部被跳过,不再放置。
|
||||
|
||||

|
||||
|
||||
我们可以看大, 我们的橡树上果然挂上了一个个苹果。
|
||||
Reference in New Issue
Block a user