搬运一批Bedrock wiki内容,完善翻译

This commit is contained in:
boybook
2025-03-20 00:13:44 +08:00
parent ead7392a76
commit 4896c1a4f2
163 changed files with 33930 additions and 1464 deletions

View File

@@ -1,9 +1,9 @@
---
title: Solid Entities
category: Tutorials
title: 实体碰撞体
category: 教程
tags:
- recipe
- intermediate
- 配方指南
- 中级
mentions:
- SirLich
- Joelant05
@@ -13,78 +13,82 @@ mentions:
- ThomasOrs
---
Solid entities are entities that the player can bump into, step on, or otherwise physically interact with without passing through. Entities like this have many uses, such as emulating blocks.
# 实体碰撞体
This page will discuss some of the ways that solid entities can be created.
<!--@include: @/wiki/bedrock-wiki-mirror.md-->
Not all techniques are ideal for all scenarios. Experiment, and figure out what works best for you.
实体碰撞体是指玩家能够碰撞、踩踏或与之发生物理互动,而不会穿透的实体。这类实体有多种用途,例如模拟方块效果。
## Runtime Identifiers
本页将探讨几种创建实体碰撞体的方法。
[Runtime identifiers](/entities/runtime-identifier) can be used to achieve solid entities, but currently only 2, each with a specific shape, and their own side effects. Neither collision shapes are possible to change or scale.
并非所有技术都适用于所有场景。建议多加实验,找到最适合您需求的方案。
### Boat
## 运行时标识符
<CodeHeader>BP/entities/entity_name.json</CodeHeader>
通过[运行时标识符](/entities/runtime-identifier)可以实现实体碰撞效果。但目前仅支持两种预设形态,每种形态具有特定的碰撞箱及副作用。且两种模型的碰撞形状均不可调节或缩放。
```json
### 船型实体
::: code-group
```json [BP/entities/entity_name.json]
{
"format_version": "1.16.0",
"minecraft:entity": {
"description": {
"identifier": "wiki:solid_entity",
"runtime_identifier": "minecraft:boat"
. . .
// 此处省略其他配置...
}
}
}
```
:::
- Boat-shaped solid collision
- Certain other boat-like effects
- 采用船形的实体碰撞箱
- 具备部分船只特有交互特性
### Shulker
### 潜影贝型实体
<CodeHeader>BP/entities/entity_name.json</CodeHeader>
```json
::: code-group
```json [BP/entities/entity_name.json]
{
"format_version": "1.16.0",
"minecraft:entity": {
"description": {
"identifier": "wiki:solid_entity",
"runtime_identifier": "minecraft:shulker"
. . .
// 此处省略其他配置...
}
}
}
```
:::
- 1x1 block sized solid collision.
- Sticks to block grid.
- Teleports randomly when supporting block removed.
- 1×1方块尺寸的实体碰撞箱
- 固定于方块网格
- 当支撑方块被移除时会随机瞬移
## minecraft:is_stackable
## minecraft:is_stackable 组件
Add `minecraft:is_stackable` to your entity you want to be treated as being solid.
**Note:** This requires editing `player.json` if you wish the entity to be solid for the player.
通过给实体添加`minecraft:is_stackable`组件可使其具有实体碰撞属性。
**注意:** 如果希望实体对玩家而言具有碰撞,需要修改`player.json`文件。
`"minecraft:is_stackable": {}`
You will also need to add `minecraft:push_through` and set its `value` parameter to 1.
同时还需添加`minecraft:push_through`组件,并将其`value`参数设为1
`"minecraft:push_through": 1`
(they should both go in `components`)
(这两个组件都应置于`components`项下)
## Faking it with blocks
## 模拟方块效果
In some scenarios, it's probably better to `/setblock` or `/fill` to place barrier blocks, either statically or dynamically. There needs to be both a way of placing the barriers, and removing them.
某些情况下更适合使用`/setblock`或`/fill`命令静态或动态放置屏障方块。需配套提供屏障的放置与清除机制:
`/fill ~ ~ ~ ~ ~1 ~ barrier 0 replace air`
Places barriers in a 1x1x2 area.
在1×1×2区域生成屏障方块。
`/fill ~1 ~1 ~1 ~-1 ~-1 ~-1 air 0 replace barrier`
Removes barriers within a 3x3x3 area.
清除3×3×3范围内的屏障方块。
These [commands](/animation-controllers/entity-commands) will have to be triggering at a constant rate, for consistency. They can either be triggered through entity components, or animation controllers.
为保证效果连贯性,这些[动画控制器实体指令](/animation-controllers/entity-commands)需要保持持续激活状态。可通过实体组件或动画控制器实现持续触发。