Files
netease-modsdk-wiki/docs/mcguide/20-玩法开发/15-自定义游戏内容/3-自定义生物/03-生物位置绑定.md
2025-03-17 13:24:39 +08:00

90 lines
2.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
front:
hard: 入门
time: 分钟
---
# 实体位置绑定
开发者也可以在entity json中增加位置组件来增加可以骑乘的位置该组件以 `minecraft:rideable` 开头,以**minecraft:boat**
```json
"format_version": "1.13.0",
"minecraft:entity": {
"description": {
"identifier": "minecraft:boat",
"is_spawnable": false,
"is_summonable": true,
"is_experimental": false
},
"components": {
//省略不关注的组件
"minecraft:rideable": {
"seat_count": 2,
"interact_text": "action.interact.ride.boat",
"pull_in_entities": true,
"seats": [
{
"position": [ 0.0, -0.2, 0.0 ],
"min_rider_count": 0,
"max_rider_count": 1,
"rotate_rider_by": -90,
"lock_rider_rotation": 90
},
{
"position": [ 0.2, -0.2, 0.0 ],
"min_rider_count": 2,
"max_rider_count": 2,
"rotate_rider_by": -90,
"lock_rider_rotation": 90
},
{
"position": [ -0.6, -0.2, 0.0 ],
"min_rider_count": 2,
"max_rider_count": 2,
"lock_rider_rotation": 90
}
]
},
}
}
}
```
**minecraft:horse_wild**
```
"minecraft:rideable": {
"seat_count": 1,
"family_types": [
"player",
"zombie"
],
"interact_text": "action.interact.mount",
"seats": {
"position": [ 0.0, 1.1, -0.2 ]
}
},
```
**参数解释**
- seat_count默认值 1 改生物拥有的骑乘位置数目
- crouching_skip_interact默认值 true为true时如果与该实体互动的实体蹲伏则无法与该实体互动
- interact_text默认值“” 与玩家交互时显示的UI按钮上的文本内容
- family_types默认值 ”“,能够骑乘该实体的实体种类
- controlling_seat默认值 0 控制该实体的位置index
- pull_in_entities默认值 false如果为true则此实体会将正确family_type的实体拉入任何可用的座位
- rider_can_interact默认值 false如果为true则由骑手查看时将选择此实体
- seats 默认值 “”,位置的详细内容:
- position默认值 [0.0,0.0,0.0],该座位的位置相对于该实体的位置
- min_rider_count默认值 0 定义在可以使用此座位之前必须乘坐此实体的最少乘客数量
- max_rider_count默认值 0定义在可以使用此座位之前必须乘坐此实体的最大乘客数量
- rotate_rider_by默认值 0.0,骑乘者旋转角度
- lock_rider_rotation默认值 181.0,允许骑乘者在旋转此实体时旋转的角度(以度为单位),忽略此设置时则无限制。