完整版BedrockWiki镜像!
This commit is contained in:
@@ -1,70 +1,74 @@
|
||||
---
|
||||
title: Advanced Molang
|
||||
title: 进阶Molang
|
||||
toc_max_level: 2
|
||||
mentions:
|
||||
- Ciosciaa
|
||||
- TheItsNameless
|
||||
---
|
||||
|
||||
## Values
|
||||
# 进阶Molang
|
||||
|
||||
- All expressions in Molang return a value for the sake of checks against equality. Most expressions return `0`. Notably, assignments return the value assigned and loops return the resolved value of the looping statements, if one would exist.
|
||||
- All values in Molang are effectively single-precision floats.
|
||||
- `this` is used to refer to the field's current value as it accumulated during evaluation. It is only observed to be usable in animations, but it may be usable elsewhere. As an example, if the accumulated transformations on the `x` `scale` of a bone would yield `62`, a final animation with a `x` `scale` of `-this` would resolve to `-62`, unsetting the prior transformations. This is used in vanilla animations in a number of places. Outside of animation contexts, `this` appears to always resolve to `0`.
|
||||
<!--@include: @/wiki/bedrock-wiki-mirror.md-->
|
||||
|
||||
### Booleans
|
||||
## 值类型
|
||||
|
||||
- Booleans are usable in Molang. `true` resolves to `1`, and `false` resolves to `0`.
|
||||
- 所有Molang表达式都会返回一个值以便进行相等性检查。大多数表达式返回`0`。特别地,赋值表达式会返回被赋予的值,循环语句会返回循环体内最后一个解析的值(如果存在)。
|
||||
- Molang中的所有值本质上都是单精度浮点数。
|
||||
- `this`用于指代当前字段在运算过程中累积的当前值。目前仅在动画系统中被观察到可用,但可能在其他场景也有用途。例如,如果骨骼在`x`轴上的缩放变换累积结果为`62`,那么最终动画中`x`轴的`scale`设置为`-this`时,结果将为`-62`,这会抵消之前的变换效果。这一特性在大量原版动画中都有应用。在非动画上下文中,`this`似乎始终解析为`0`。
|
||||
|
||||
### Numbers
|
||||
### 布尔值
|
||||
|
||||
- You can use leading `0`s in front of numbers, for example, to line them up better in your code.
|
||||
- Numbers can use exponential notation, such as `2.5e2`, which would be equal to 250. `e` can be suffixed with `+` or `-` to direct the power.
|
||||
- Numbers may be suffixed with a single `f`, often used to denote a floating point value. This can be found across vanilla code, but it is not believed to have any functionality.
|
||||
- 布尔值可在Molang中使用。`true`解析为`1`,`false`解析为`0`。
|
||||
|
||||
### Strings
|
||||
### 数值
|
||||
|
||||
- Strings use `\` (`\\` in escaped JSON) as some sort of escape or perhaps something else. It is unknown what functionality this has. It is known that the subsequent 2 characters are handed off to their own sub-parser, which does not exit correctly on a closing `'`; this means the Molang string `"v.type = '\\x';"` is invalid. `'`, which is normally disallowed on its own as it would represent the end of the string, is allowed in the 2 characters following a `\`.
|
||||
- String values are (mostly) incremental as they are represented against floats. It is possible to compare 2 individual character strings using equality or comparison operators or even to effectively "adjust" the contents of a single-character string. Multi-character behavior of such is unknown.
|
||||
- 可以在数值前添加前导零(例如`0012`),以便在代码中对齐。
|
||||
- 数值支持科学计数法(如`2.5e2`等价于250)。指数部分可使用`+`或`-`符号。
|
||||
- 数值可以后缀单个`f`(常见于原版代码中用于标记浮点数),但目前未发现该符号具有实际功能影响。
|
||||
|
||||
## Operators
|
||||
### 字符串
|
||||
|
||||
The complete precedence list, from first to last evaluated:
|
||||
- 字符串使用`\`(JSON转义后为`\\`)作为某种转义符或其他功能。其具体功能尚不明确。已知后续两个字符会被传递给独立子解析器,但该子解析器遇到结束单引号`'`时无法正确退出。例如Molang字符串`"v.type = '\\x';"`是无效的。而单独存在的`'`通常会被视为字符串结束符,但在`\`后的两个字符中出现时会被允许。
|
||||
- 字符串值(多数情况下)以浮点数形式进行增量表示。可以通过等式或比较运算符对单字符字符串进行比较,甚至可对单字符字符串内容进行"调整"。多字符字符串在此类操作中的行为尚不明确。
|
||||
|
||||
1. `()` and `[]`
|
||||
## 运算符
|
||||
|
||||
运算符优先级列表(从高到低):
|
||||
|
||||
1. `()` 和 `[]`
|
||||
2. `->`
|
||||
3. `!` and `-` (unary negation)
|
||||
4. `*` and `/`
|
||||
5. `+` and `-` (binary subtraction)
|
||||
6. `<`, `<=`, `>`, and `>=`
|
||||
7. `==` and `!=`
|
||||
3. `!` 和 `-`(一元取反)
|
||||
4. `*` 和 `/`
|
||||
5. `+` 和 `-`(二元减法)
|
||||
6. `<`, `<=`, `>` 和 `>=`
|
||||
7. `==` 和 `!=`
|
||||
8. `&&`
|
||||
9. `||`
|
||||
10. `?` and `? :`
|
||||
10. `?` 和 `? :`
|
||||
11. `??`
|
||||
12. `=`
|
||||
13. `return`
|
||||
|
||||
- Operators are considered from left to right for all operators except the conditionals.
|
||||
- Multiple `->` cannot be used in the same statement.
|
||||
- Logical operators short-circuit.
|
||||
- 除条件运算符外,所有运算符均按从左到右顺序执行。
|
||||
- 同一语句中不可重复使用`->`运算符。
|
||||
- 逻辑运算符具有短路特性。
|
||||
|
||||
## Statements
|
||||
## 语句
|
||||
|
||||
- Assignments return the value assigned. You can therefore chain assignments if you need separate variables to work with from a single value, such as with `v.iterator_x = (v.iterator_z = math.random_integer(16, 32));`.
|
||||
- The last statement inside a brace scope does not need to end with a `;`.
|
||||
- Brace scopes can be used anywhere an expression can be used. `v.spawn_point ?? {v.target = false;};`, for example, would set `v.target` to `false` if `v.spawn_point` were not defined.
|
||||
- 赋值语句会返回被赋予的值。因此可以进行链式赋值(例如`v.iterator_x = (v.iterator_z = math.random_integer(16, 32));`)。
|
||||
- 大括号作用域内的最后一条语句无需以`;`结尾。
|
||||
- 大括号作用域可以在任何表达式可用的位置使用。例如`v.spawn_point ?? {v.target = false;};`会在`v.spawn_point`未定义时将`v.target`设为`false`。
|
||||
|
||||
## Collections
|
||||
## 集合类型
|
||||
|
||||
- Entity iterables (such as the result of `q.get_nearby_entities`) are their own "type". They are not compatible with subscripts.
|
||||
- Arrays, likewise, are not compatible with entity iterable operations, such as `q.count`.
|
||||
- The result of array subscripts cannot directly be an argument to `+`, `-`, `*`, or `/` but may still be used directly as function parameters (even math functions) or with other operators.
|
||||
- 实体可迭代对象(如`q.get_nearby_entities`的结果)属于独立"类型",不可与下标运算符兼容使用。
|
||||
- 数组类型同样无法与实体可迭代操作(如`q.count`)兼容使用。
|
||||
- 数组下标结果不可直接作为`+`, `-`, `*`, `/`的操作数,但可作为函数参数(包括数学函数)或与其他运算符配合使用。
|
||||
|
||||
## Evaluation
|
||||
## 表达式求值
|
||||
|
||||
- `initialize` and `pre_animation` are lazily concatenated. Molang strings in these arrays must be syntactically valid independently, but the basic concatenation of all independent strings must also be a valid Molang input.
|
||||
- `initialize`和`pre_animation`数组中的语句采用延迟连接方式。这些数组中的每个Molang字符串必须独立语法有效,同时所有字符串连接后也需构成有效的Molang输入。
|
||||
|
||||
## Limits
|
||||
## 限制条件
|
||||
|
||||
- Molang showed no reasonable limits to any language functionality, aside from numeric size. Loop counts, string lengths, Molang input length, collection size, etc., were observed to hold in very unreasonable situations.
|
||||
- 除数值大小外,未发现Molang存在合理的功能限制。在极端场景下仍可观察到循环计数、字符串长度、输入长度、集合大小等参数的正常运行。
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: Menu Categories
|
||||
title: 菜单分类
|
||||
mentions:
|
||||
- Warhead51707
|
||||
- yanasakana
|
||||
@@ -13,37 +13,39 @@ mentions:
|
||||
- QuazChick
|
||||
---
|
||||
|
||||
Menu categories determine where items and blocks appear inside of the creative inventory and recipe book.
|
||||
# 菜单分类
|
||||
|
||||
- A `category` can be defined to place the item under a tab (such as construction). Click [here](#list-of-categories) for a list of valid categories.
|
||||
<!--@include: @/wiki/bedrock-wiki-mirror.md-->
|
||||
|
||||
- A `group` specifies which expandable group the item is placed into. If you use a custom value, a new expandable group won't be created, however items with the group will be placed next to each other in the creative inventory. Click [here](#list-of-groups) for a list of expandable groups.
|
||||
菜单分类决定了物品和方块在创造模式物品栏和配方书中的显示位置。
|
||||
|
||||
- You can also set `is_hidden_in_commands` to true to remove this block/item from commands, such as `/give` and `/setblock`.
|
||||
- 通过定义`category`可将物品放置于特定标签页下(如"construction"建筑类)。点击[此处](#分类列表)查看有效分类列表。
|
||||
|
||||
If `menu_category` is omitted, the item will only be accessible through commands and won't appear in the creative inventory or recipe book.
|
||||
- `group`参数用于指定物品所在的可展开分组。使用自定义值时不会创建新分组,但相同分组的物品会在创造模式物品栏中相邻排列。点击[此处](#分组列表)查看可展开分组列表。
|
||||
|
||||
**NOTE:** The menu category of custom spawn eggs cannot be modified. You must instead create a custom item with the `minecraft:entity_placer` component.
|
||||
- 设置`is_hidden_in_commands`为true可让该物品/方块无法通过`/give`和`/setblock`等命令获取。
|
||||
|
||||
<CodeHeader></CodeHeader>
|
||||
若省略`menu_category`参数,物品将只能通过命令获取,且不会出现在创造模式物品栏或配方书中。
|
||||
|
||||
```json
|
||||
**注意:** 自定义刷怪蛋的菜单分类不可修改,需使用`minecraft:entity_placer`组件创建自定义物品实现类似功能。
|
||||
|
||||
::: code-group
|
||||
```json [菜单分类配置]
|
||||
"menu_category": {
|
||||
"category": "construction", // Tab the item is placed under
|
||||
"group": "itemGroup.name.door", // Optional - Group the item is placed into
|
||||
"is_hidden_in_commands": false // Optional - default is false (item is usable in commands)
|
||||
"category": "construction", // 物品所在的标签页
|
||||
"group": "itemGroup.name.door", // 可选 - 物品所在的展开分组
|
||||
"is_hidden_in_commands": false // 可选 - 默认为false(可通过命令使用)
|
||||
}
|
||||
```
|
||||
|
||||
:::danger HIDDEN ITEMS INACCESSIBLE IN COMMANDS ([MCPE-177866](https://bugs.mojang.com/browse/MCPE-177866))
|
||||
Currently, setting the category to "none" in a custom item (not block) prevents the item from being used in commands, overriding the "is_hidden_in_commands" option. This issue doesn't affect blocks.
|
||||
:::danger 命令中隐藏物品不可访问的问题 ([MCPE-177866](https://bugs.mojang.com/browse/MCPE-177866))
|
||||
当前版本中,将自定义物品(非方块)的category设为"none"会覆盖"is_hidden_in_commands"设置,导致无法通过命令使用该物品。此问题不影响方块类物品。
|
||||
:::
|
||||
|
||||
## Block Example
|
||||
## 方块示例
|
||||
|
||||
<CodeHeader>BP/blocks/balsa_wood.json</CodeHeader>
|
||||
|
||||
```json
|
||||
::: code-group
|
||||
```json [BP/blocks/balsa_wood.json]
|
||||
{
|
||||
"format_version": "1.20.50",
|
||||
"minecraft:block": {
|
||||
@@ -51,18 +53,18 @@ Currently, setting the category to "none" in a custom item (not block) prevents
|
||||
"identifier": "wiki:balsa_wood",
|
||||
"menu_category": {
|
||||
"category": "nature",
|
||||
"group": "itemGroup.name.wood" // Placed into an expandable group
|
||||
"group": "itemGroup.name.wood" // 归入可展开分组
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
:::
|
||||
|
||||
## Item Example
|
||||
## 物品示例
|
||||
|
||||
<CodeHeader>BP/items/dagger.json</CodeHeader>
|
||||
|
||||
```json
|
||||
::: code-group
|
||||
```json [BP/items/dagger.json]
|
||||
{
|
||||
"format_version": "1.20.50",
|
||||
"minecraft:item": {
|
||||
@@ -70,111 +72,112 @@ Currently, setting the category to "none" in a custom item (not block) prevents
|
||||
"identifier": "wiki:dagger",
|
||||
"menu_category": {
|
||||
"category": "equipment",
|
||||
"is_hidden_in_commands": true // Item cannot be used in commands
|
||||
"is_hidden_in_commands": true // 无法通过命令使用
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
:::
|
||||
|
||||
## List of Categories
|
||||
## 分类列表
|
||||
|
||||
_For use with `menu_category` parameter, `category`._
|
||||
_用于`menu_category`参数中的`category`属性_
|
||||
|
||||
| Category | Description |
|
||||
| ------------ | -------------------------------------------------------- |
|
||||
| construction | Added to the "Contruction" tab. |
|
||||
| equipment | Added to the "Equipment" tab. |
|
||||
| items | Added to the "Items" tab. |
|
||||
| nature | Added to the "Nature" tab. |
|
||||
| none | Not added to a tab and only accessible through commands. |
|
||||
| 分类名称 | 描述 |
|
||||
| ------------ | ----------------------------------------- |
|
||||
| construction | 显示在"建筑"标签页 |
|
||||
| equipment | 显示在"装备"标签页 |
|
||||
| items | 显示在"物品"标签页 |
|
||||
| nature | 显示在"自然"标签页 |
|
||||
| none | 不显示在任何标签页,只能通过命令获取 |
|
||||
|
||||
## List of Groups
|
||||
## 分组列表
|
||||
|
||||
_For use with the `menu_category` parameter, `group`._
|
||||
_用于`menu_category`参数中的`group`属性_
|
||||
|
||||
<!-- page_dumper_start -->
|
||||
| Creative Categories: |
|
||||
| --------------------------------- |
|
||||
| itemGroup.name.anvil |
|
||||
| itemGroup.name.arrow |
|
||||
| itemGroup.name.axe |
|
||||
| itemGroup.name.banner |
|
||||
| itemGroup.name.banner_pattern |
|
||||
| itemGroup.name.bed |
|
||||
| itemGroup.name.boat |
|
||||
| itemGroup.name.boots |
|
||||
| itemGroup.name.buttons |
|
||||
| itemGroup.name.candles |
|
||||
| itemGroup.name.chalkboard |
|
||||
| itemGroup.name.chest |
|
||||
| itemGroup.name.chestboat |
|
||||
| itemGroup.name.chestplate |
|
||||
| itemGroup.name.concrete |
|
||||
| itemGroup.name.concretePowder |
|
||||
| itemGroup.name.cookedFood |
|
||||
| itemGroup.name.copper |
|
||||
| itemGroup.name.coral |
|
||||
| itemGroup.name.coral_decorations |
|
||||
| itemGroup.name.crop |
|
||||
| itemGroup.name.door |
|
||||
| itemGroup.name.dye |
|
||||
| itemGroup.name.enchantedBook |
|
||||
| itemGroup.name.fence |
|
||||
| itemGroup.name.fenceGate |
|
||||
| itemGroup.name.firework |
|
||||
| itemGroup.name.fireworkStars |
|
||||
| itemGroup.name.flower |
|
||||
| itemGroup.name.glass |
|
||||
| itemGroup.name.glassPane |
|
||||
| itemGroup.name.glazedTerracotta |
|
||||
| itemGroup.name.goatHorn |
|
||||
| itemGroup.name.grass |
|
||||
| itemGroup.name.hanging_sign |
|
||||
| itemGroup.name.helmet |
|
||||
| itemGroup.name.hoe |
|
||||
| itemGroup.name.horseArmor |
|
||||
| itemGroup.name.leaves |
|
||||
| itemGroup.name.leggings |
|
||||
| itemGroup.name.lingeringPotion |
|
||||
| itemGroup.name.log |
|
||||
| itemGroup.name.minecart |
|
||||
| itemGroup.name.miscFood |
|
||||
| itemGroup.name.mobEgg |
|
||||
| itemGroup.name.monsterStoneEgg |
|
||||
| itemGroup.name.mushroom |
|
||||
| itemGroup.name.netherWartBlock |
|
||||
| itemGroup.name.ore |
|
||||
| itemGroup.name.permission |
|
||||
| itemGroup.name.pickaxe |
|
||||
| itemGroup.name.planks |
|
||||
| itemGroup.name.potion |
|
||||
| itemGroup.name.potterySherds |
|
||||
| itemGroup.name.pressurePlate |
|
||||
| itemGroup.name.rail |
|
||||
| itemGroup.name.rawFood |
|
||||
| itemGroup.name.record |
|
||||
| itemGroup.name.sandstone |
|
||||
| itemGroup.name.sapling |
|
||||
| itemGroup.name.sculk |
|
||||
| itemGroup.name.seed |
|
||||
| itemGroup.name.shovel |
|
||||
| itemGroup.name.shulkerBox |
|
||||
| itemGroup.name.sign |
|
||||
| itemGroup.name.skull |
|
||||
| itemGroup.name.slab |
|
||||
| 创造模式分组: |
|
||||
| ----------------------------- |
|
||||
| itemGroup.name.anvil |
|
||||
| itemGroup.name.arrow |
|
||||
| itemGroup.name.axe |
|
||||
| itemGroup.name.banner |
|
||||
| itemGroup.name.banner_pattern |
|
||||
| itemGroup.name.bed |
|
||||
| itemGroup.name.boat |
|
||||
| itemGroup.name.boots |
|
||||
| itemGroup.name.buttons |
|
||||
| itemGroup.name.candles |
|
||||
| itemGroup.name.chalkboard |
|
||||
| itemGroup.name.chest |
|
||||
| itemGroup.name.chestboat |
|
||||
| itemGroup.name.chestplate |
|
||||
| itemGroup.name.concrete |
|
||||
| itemGroup.name.concretePowder |
|
||||
| itemGroup.name.cookedFood |
|
||||
| itemGroup.name.copper |
|
||||
| itemGroup.name.coral |
|
||||
| itemGroup.name.coral_decorations |
|
||||
| itemGroup.name.crop |
|
||||
| itemGroup.name.door |
|
||||
| itemGroup.name.dye |
|
||||
| itemGroup.name.enchantedBook |
|
||||
| itemGroup.name.fence |
|
||||
| itemGroup.name.fenceGate |
|
||||
| itemGroup.name.firework |
|
||||
| itemGroup.name.fireworkStars |
|
||||
| itemGroup.name.flower |
|
||||
| itemGroup.name.glass |
|
||||
| itemGroup.name.glassPane |
|
||||
| itemGroup.name.glazedTerracotta |
|
||||
| itemGroup.name.goatHorn |
|
||||
| itemGroup.name.grass |
|
||||
| itemGroup.name.hanging_sign |
|
||||
| itemGroup.name.helmet |
|
||||
| itemGroup.name.hoe |
|
||||
| itemGroup.name.horseArmor |
|
||||
| itemGroup.name.leaves |
|
||||
| itemGroup.name.leggings |
|
||||
| itemGroup.name.lingeringPotion|
|
||||
| itemGroup.name.log |
|
||||
| itemGroup.name.minecart |
|
||||
| itemGroup.name.miscFood |
|
||||
| itemGroup.name.mobEgg |
|
||||
| itemGroup.name.monsterStoneEgg|
|
||||
| itemGroup.name.mushroom |
|
||||
| itemGroup.name.netherWartBlock|
|
||||
| itemGroup.name.ore |
|
||||
| itemGroup.name.permission |
|
||||
| itemGroup.name.pickaxe |
|
||||
| itemGroup.name.planks |
|
||||
| itemGroup.name.potion |
|
||||
| itemGroup.name.potterySherds |
|
||||
| itemGroup.name.pressurePlate |
|
||||
| itemGroup.name.rail |
|
||||
| itemGroup.name.rawFood |
|
||||
| itemGroup.name.record |
|
||||
| itemGroup.name.sandstone |
|
||||
| itemGroup.name.sapling |
|
||||
| itemGroup.name.sculk |
|
||||
| itemGroup.name.seed |
|
||||
| itemGroup.name.shovel |
|
||||
| itemGroup.name.shulkerBox |
|
||||
| itemGroup.name.sign |
|
||||
| itemGroup.name.skull |
|
||||
| itemGroup.name.slab |
|
||||
| itemGroup.name.smithing_templates |
|
||||
| itemGroup.name.splashPotion |
|
||||
| itemGroup.name.stainedClay |
|
||||
| itemGroup.name.stairs |
|
||||
| itemGroup.name.stone |
|
||||
| itemGroup.name.stoneBrick |
|
||||
| itemGroup.name.sword |
|
||||
| itemGroup.name.trapdoor |
|
||||
| itemGroup.name.walls |
|
||||
| itemGroup.name.wood |
|
||||
| itemGroup.name.wool |
|
||||
| itemGroup.name.woolCarpet |
|
||||
| itemGroup.name.splashPotion |
|
||||
| itemGroup.name.stainedClay |
|
||||
| itemGroup.name.stairs |
|
||||
| itemGroup.name.stone |
|
||||
| itemGroup.name.stoneBrick |
|
||||
| itemGroup.name.sword |
|
||||
| itemGroup.name.trapdoor |
|
||||
| itemGroup.name.walls |
|
||||
| itemGroup.name.wood |
|
||||
| itemGroup.name.wool |
|
||||
| itemGroup.name.woolCarpet |
|
||||
|
||||
*Last updated for 1.20.10*
|
||||
<!-- page_dumper_end -->
|
||||
*最后更新版本:1.20.10*
|
||||
<!-- page_dumper_end -->
|
||||
@@ -1,106 +1,113 @@
|
||||
---
|
||||
title: File Types
|
||||
title: 文件类型
|
||||
max_toc_level : 3
|
||||
mentions:
|
||||
- Ciosciaa
|
||||
- SirLich
|
||||
---
|
||||
|
||||
A number of file types exist for *Minecraft*, all for importing content. All *Minecraft* files are ZIP archives renamed to use a `mc…` extension. These archives can currently be divided into three sets:
|
||||
# 文件类型
|
||||
|
||||
- **Levels (`mcworld` and `mcproject`)**: level data and associated resources for worlds and projects
|
||||
- **Assets (`mcpack` and `mctemplate`)**: cosmetics or supporting assets for worlds
|
||||
- **Composites (`mcaddon` and `mceditoraddon)`**: used to import up to one world or project and any number of asset types
|
||||
<!--@include: @/wiki/bedrock-wiki-mirror.md-->
|
||||
|
||||
All file types for Minecraft can be opened as any file, launching Minecraft and importing the content. When packages are imported, they are automatically unpacked into their constituent files and directories. If it was not already open, most file types will launch Minecraft in normal mode; `mcproject` and `mceditoraddon` will instead launch Minecraft into Editor mode.
|
||||
*Minecraft* 存在多种文件类型,均用于导入内容。所有 *Minecraft* 文件本质上都是 ZIP 压缩包,通过重命名使用 `mc...` 扩展名。这些压缩包目前可分为三大类:
|
||||
|
||||
# Levels
|
||||
Levels represent save data and resources for regular worlds and Editor projects. All levels, regardless of mode, are imported to `minecraftWorlds` in the `com.mojang` directory.
|
||||
- **世界文件(`mcworld` 与 `mcproject`)**:包含世界或项目的关卡数据及相关资源
|
||||
- **资源文件(`mcpack` 与 `mctemplate`)**:包含世界的装饰性素材或支持性资源
|
||||
- **复合文件(`mcaddon` 与 `mceditoraddon`)**:可同时包含最多一个世界/项目文件及任意数量的资源文件
|
||||
|
||||
Importing an exact duplicate of an existing saved level will create a duplicate saved level. Composite archives will only import one level if multiple are included, including across nested composite archives.
|
||||
所有 *Minecraft* 文件类型均可通过常规文件打开方式启动游戏并导入内容。当资源包被导入时,会自动解压到对应的文件目录结构中。若游戏未处于运行状态,多数文件类型会以普通模式启动游戏;而 `mcproject` 和 `mceditoraddon` 则会直接进入编辑器模式。
|
||||
|
||||
## Worlds
|
||||
# 世界文件
|
||||
世界文件代表普通世界与编辑器项目的存档数据及资源。所有世界文件无论模式,都会被导入到 `com.mojang` 目录下的 `minecraftWorlds` 文件夹中。
|
||||
|
||||
若导入与已有存档完全相同的世界文件,会生成重复存档。复合文件包中若包含多个世界文件(包括嵌套的复合文件),只会导入其中一个世界。
|
||||
|
||||
## 普通世界
|
||||
`mcworld`
|
||||
Archive encapsulating an individual world
|
||||
单个世界的压缩存档包
|
||||
|
||||
World archives can be created a few different ways:
|
||||
- Zipping the *contents* of a world directory and renaming the extension from `zip` to `mcworld`
|
||||
- Using the "Export World" button on the Game settings screen for a world
|
||||
- In Editor mode, exporting the world from the File → Export as → Playable world menu option. The world will be saved to the `projectbackups` directory in the `com.mojang` folder.
|
||||
- In Editor mode, running the `/project export world` command. The world will be saved to the `projectbackups` directory in the `com.mojang` folder.
|
||||
创建世界存档的几种方式:
|
||||
- 将世界目录的**全部内容**打包为 ZIP 文件后,将扩展名改为 `mcworld`
|
||||
- 在游戏设置界面点击"导出世界"按钮
|
||||
- 在编辑器模式中,通过 文件 → 导出为 → 可游玩世界 菜单选项导出。存档将保存在 `com.mojang` 文件夹的 `projectbackups` 目录中
|
||||
- 在编辑器模式中运行 `/project export world` 命令。存档将保存在 `com.mojang` 文件夹的 `projectbackups` 目录中
|
||||
|
||||
Importing a world package while *Minecraft* is launched in Editor mode will import the world as a project. The imported world will then be inaccessible outside Editor mode and will need to be re-exported as a world for playing. Editor extension packs bundled in a world archive will be retained on import outside Editor mode.
|
||||
在编辑器模式下导入世界文件会将其作为项目导入。此时该世界将无法在编辑器模式之外访问,需重新导出为普通世界才能游玩。世界文件中包含的编辑器扩展包在非编辑器模式导入时会被保留。
|
||||
|
||||
## Projects
|
||||
## 项目文件
|
||||
`mcproject`
|
||||
Archive encapsulating an individual Editor project
|
||||
单个编辑器项目的压缩存档包
|
||||
|
||||
Project archives can be created two different ways:
|
||||
- Zipping the *contents* of a project directory and renaming the extension from `zip` to `mcproject`.
|
||||
- Using the "Export Project" button on the Game settings screen for a world
|
||||
- In Editor mode, running the `/project export project` command. The world will be saved to the `projectbackups` directory in the `com.mojang` folder.
|
||||
创建项目存档的两种方式:
|
||||
- 将项目目录的**全部内容**打包为 ZIP 文件后,将扩展名改为 `mcproject`
|
||||
- 在编辑器模式中运行 `/project export project` 命令。存档将保存在 `com.mojang` 文件夹的 `projectbackups` 目录中
|
||||
|
||||
If *Minecraft* is not open, launching a `mcproject` file will open Editor mode. Importing a `mcproject` will fail if *Minecraft* is open but not in Editor mode.
|
||||
若游戏未运行,打开 `mcproject` 文件会直接进入编辑器模式。若游戏已运行但未处于编辑器模式,导入 `mcproject` 文件会失败。
|
||||
|
||||
# Assets
|
||||
Asset archives represent a singular instance of a number of non-level contents:
|
||||
# 资源文件
|
||||
资源文件代表各种非世界类内容的独立实例:
|
||||
- 行为包
|
||||
- 资源包
|
||||
- 皮肤包
|
||||
- 世界模板
|
||||
|
||||
- Behavior packs
|
||||
- Resource packs
|
||||
- Skin packs
|
||||
- World templates
|
||||
所有资源文件都包含描述其内容的清单文件(manifest)。若资源清单的 UUID 和版本号与同类型现有资源完全一致,导入将会失败。注意行为包和资源包共享相同的 UUID/版本号命名空间。内置于世界、项目或模板中的行为包/资源包不会被视为重复资源。
|
||||
|
||||
All asset archives include a manifest describing their contents. An asset archive will fail to import if its manifest UUID and version exactly matches an existing asset archive of the same type. Note that behavior and resource packs share the same UUID/version space. Behavior and resource packs self-contained within a world, project, or template will not count as duplicates for the sake of importing.
|
||||
虽然 `mcpack` 和 `mctemplate` 功能相同,但建议遵循以下规范:
|
||||
- 使用 `mcpack` 作为行为包、资源包、皮肤包
|
||||
- 使用 `mctemplate` 作为世界模板
|
||||
以便用户更直观地识别内容类型。复合文件中可包含任意数量的资源文件。
|
||||
|
||||
Both asset extensions, `mcpack` and `mctemplate`, appear to functionally behave the same. It's best practice to use `mcpack` for behavior, resource, and skin packs and `mctemplate` for world templates to make it more clear what's being installed. Any number of asset archives may be included in a composite archive.
|
||||
|
||||
## Packs
|
||||
## 资源包
|
||||
`mcpack`
|
||||
Package representing an individual behavior pack, resource pack, skin pack, or world template. It's recommended only to use `mctemplate` for behavior packs, resource packs, or skin packs.
|
||||
代表单个行为包、资源包、皮肤包或世界模板的压缩包。建议仅将 `mctemplate` 用于世界模板。
|
||||
|
||||
Packs are only created manually, by zipping the contents of a behavior pack, resource pack, or skin pack directory and renaming the extension from `zip` to `mcpack`. Behavior and resource packs are installed globally and do not conflict with matching behavior or resource packs installed in worlds, projects, or templates.
|
||||
手动创建方式:
|
||||
- 将行为包、资源包或皮肤包目录的全部内容打包为 ZIP 文件后,将扩展名改为 `mcpack`
|
||||
行为包与资源包会全局安装,不会与世界/项目/模板中安装的同名资源冲突。
|
||||
|
||||
### Behavior Packs
|
||||
Behavior packs are attached to servers to change or extend gameplay. Behavior packs are installed to the `behavior_packs` directory in the `com.mojang` folder.
|
||||
### 行为包
|
||||
行为包用于修改或扩展游戏玩法,安装在 `com.mojang` 目录下的 `behavior_packs` 文件夹中。
|
||||
|
||||
Development behavior packs must be placed in the `development_behavior_packs` directory under `com.mojang` manually.
|
||||
开发中的行为包需手动放置到 `com.mojang` 下的 `development_behavior_packs` 目录。
|
||||
|
||||
### Resource Packs
|
||||
Resource packs are attached to clients to affect sounds, visuals, etc. Resource packs are installed to the `resource_packs` directory in the `com.mojang` folder.
|
||||
### 资源包
|
||||
资源包用于修改客户端音效、视觉效果等,安装在 `com.mojang` 目录下的 `resource_packs` 文件夹中。
|
||||
|
||||
Development resource packs must be placed in the `development_resource_packs` directory under `com.mojang` manually.
|
||||
开发中的资源包需手动放置到 `com.mojang` 下的 `development_resource_packs` 目录。
|
||||
|
||||
### Skin Packs
|
||||
Skin packs are client-only packs for custom skins. Skin packs are installed to the `skin_packs` directory in the `com.mojang` folder.
|
||||
### 皮肤包
|
||||
皮肤包是仅限客户端的自定义皮肤资源,安装在 `com.mojang` 目录下的 `skin_packs` 文件夹中。
|
||||
|
||||
Development skin packs must be placed in the `development_skin_packs` directory under `com.mojang` manually, but this feature appears non-functional.
|
||||
开发中的皮肤包需手动放置到 `com.mojang` 下的 `development_skin_packs` 目录,但此功能目前似乎不可用。
|
||||
|
||||
## World Templates
|
||||
## 世界模板
|
||||
`mctemplate`
|
||||
Package representing an individual behavior pack, resource pack, skin pack, or world template. It's recommended only to use `mctemplate` for world templates.
|
||||
代表单个行为包、资源包、皮肤包或世界模板的压缩包。建议仅将 `mctemplate` 用于世界模板。
|
||||
|
||||
World templates are installed to the `world_templates` directory under `com.mojang`. World templates can be constructed in a few different ways:
|
||||
- Zipping the *contents* of a world directory, adding a world template manifest, and renaming the extension from `zip` to `mctemplate`
|
||||
- In Editor mode, using the "Export Template" button on the Game settings screen for a world
|
||||
- In Editor mode, running the `/project export template` command. The world will be saved to the `projectbackups` directory in the `com.mojang` folder.
|
||||
世界模板安装在 `com.mojang` 目录下的 `world_templates` 文件夹中。创建方式:
|
||||
- 将世界目录的**全部内容**打包为 ZIP 文件,添加模板清单文件后,将扩展名改为 `mctemplate`
|
||||
- 在编辑器模式中点击游戏设置界面的"导出模板"按钮
|
||||
- 在编辑器模式中运行 `/project export template` 命令。存档将保存在 `com.mojang` 文件夹的 `projectbackups` 目录中
|
||||
|
||||
# Composites
|
||||
Composite archives are used to import up to *one* level archive and any number or combination of asset archives in a single import action. In general, contents to a composite must be packaged. Directories can also be given *on the top level* of a composite archive for importing asset types (behavior packs, resource packs, skin packs, and world templates) without needing to pre-package them. Nested sub-directories for organization may not be used.
|
||||
# 复合文件
|
||||
复合文件用于在一次导入操作中同时导入**最多一个**世界文件及任意数量的资源文件。通常复合文件中的内容需要预先打包,但资源类型(行为包/资源包/皮肤包/世界模板)的原始目录也可直接放在复合文件顶层(不可使用嵌套子目录)。
|
||||
|
||||
Composite contents are treated as usual. For example, importing a `mcaddon` contianing a `mcworld` while in Editor mode will import the world as a project.
|
||||
复合文件的内容按常规方式处理。例如在编辑器模式导入包含 `mcworld` 的 `mcaddon` 时,世界文件会作为项目导入。
|
||||
|
||||
Composite archives may also contain any number or nesting of other composite archives, even across *Minecraft* modes. Nested composite archives cannot be used to get around the singular world import restriction.
|
||||
复合文件可包含任意数量或层级的其他复合文件(跨模式也可)。但嵌套复合文件不能突破单世界导入限制。
|
||||
|
||||
Composites can only be constructed manually by zipping archives and asset types.
|
||||
复合文件只能通过手动打包现有文件/目录创建。
|
||||
|
||||
## Add-Ons
|
||||
## 附加包
|
||||
`mcaddon`
|
||||
Generic composite content archive
|
||||
通用复合内容存档
|
||||
|
||||
Importing a `mcaddon` package while *Minecraft* is launched in Editor mode will import any contained world as a project. The imported world will then be inaccessible outside Editor mode and will need to be re-exported as a world for playing. Asset types are imported as usual.
|
||||
在编辑器模式导入 `mcaddon` 时,包含的世界文件会作为项目导入。此时该世界将无法在编辑器模式之外访问,需重新导出为普通世界才能游玩。其他资源类型会正常导入。
|
||||
|
||||
## Editor Add-Ons
|
||||
## 编辑器附加包
|
||||
`mceditoraddon`
|
||||
Composite content archive for Editor mode
|
||||
专用于编辑器模式的复合内容存档
|
||||
|
||||
If *Minecraft* is not open, launching a `mcproject` file will open Editor mode. Importing a `mcproject` will fail if *Minecraft* is open but not in Editor mode.
|
||||
若游戏未运行,打开 `mcproject` 文件会直接进入编辑器模式。若游戏已运行但未处于编辑器模式,导入 `mcproject` 文件会失败。
|
||||
@@ -1,92 +1,95 @@
|
||||
---
|
||||
title: Fog IDs
|
||||
title: 雾效ID
|
||||
mentions:
|
||||
- SirLich
|
||||
- MedicalJewel105
|
||||
- TheItsNameless
|
||||
---
|
||||
|
||||
## By Element X
|
||||
# 雾效ID
|
||||
|
||||
| ID | Note |
|
||||
<!--@include: @/wiki/bedrock-wiki-mirror.md-->
|
||||
|
||||
## 按元素X分类
|
||||
|
||||
| ID | 说明 |
|
||||
| ---------------------------------------------- | -------------------------------------------------------------------------------- |
|
||||
| minecraft:fog_bamboo_jungle | Fog used in the bamboo jungle. |
|
||||
| minecraft:fog_bamboo_jungle_hills | Fog used in the bamboo jungle hills. |
|
||||
| minecraft:fog_basalt_deltas | Fog used in the basalt deltas. Adds a gray-red tint to the edge of the sky |
|
||||
| minecraft:fog_beach | Fog used in the beach biome. |
|
||||
| minecraft:fog_birch_forest | Fog used in the birch forest |
|
||||
| minecraft:fog_birch_forest_hills | Fog used in the birch forest hills biome. |
|
||||
| minecraft:fog_cold_beach | Fog used in the cold beach biome. |
|
||||
| minecraft:fog_cold_ocean | Fog used in the cold ocean biome. |
|
||||
| minecraft:fog_cold_taiga | Fog used in the cold taiga biome. |
|
||||
| minecraft:fog_cold_taiga_hills | Fog used in the cold taiga hills biome. |
|
||||
| minecraft:fog_cold_taiga_mutated | Fog used in the mutated cold taiga biome. |
|
||||
| minecraft:fog_crimson_forest | Fog used in the crimson forest biome. Adds a red tint to the edge of the sky |
|
||||
| minecraft:fog_deep_cold_ocean | Fog used in the deep cold ocean biome. |
|
||||
| minecraft:fog_deep_frozen_ocean | Fog used in the deep frozen ocean biome. |
|
||||
| minecraft:fog_deep_lukewarm_ocean | Fog used in the deep lukewarm ocean biome. |
|
||||
| minecraft:fog_deep_ocean | Fog used in the deep ocean biome. |
|
||||
| minecraft:fog_deep_warm_ocean | Fog used in the deep warm ocean biome. |
|
||||
| minecraft:fog_default | Default fog used in the game. |
|
||||
| minecraft:fog_desert | Fog used in the desert biome. |
|
||||
| minecraft:fog_desert_hills | Fog used in the desert hills biome. |
|
||||
| minecraft:fog_extreme_hills | Fog used in the extreme hills biome. |
|
||||
| minecraft:fog_extreme_hills_edge | Fog used in the extreme hills edge biome. |
|
||||
| minecraft:fog_extreme_hills_mutated | Fog used in the mutated extreme hills biome. |
|
||||
| minecraft:fog_extreme_hills_plus_trees | Fog used in the extreme hills with trees biome. |
|
||||
| minecraft:fog_extreme_hills_plus_trees_mutated | Fog used in the mutated extreme hills with trees biome. |
|
||||
| minecraft:fog_flower_forest | Fog used in the flower forest biome. |
|
||||
| minecraft:fog_forest | Fog used in the forest biome. |
|
||||
| minecraft:fog_forest_hills | Fog used in the forest hills biome. |
|
||||
| minecraft:fog_frozen_ocean | Fog used in the frozen ocean biome. |
|
||||
| minecraft:fog_frozen_river | Fog used in the frozen river biome. |
|
||||
| minecraft:fog_hell | Fog used in the nether wastes biome. Adds a red tint to the edge of the sky |
|
||||
| minecraft:fog_ice_mountains | Fog used in the ice mountains biome. |
|
||||
| minecraft:fog_ice_plains | Fog used in the ice plains biome. |
|
||||
| minecraft:fog_ice_plains_spikes | Fog used in the ice spikes biome. |
|
||||
| minecraft:fog_jungle | Fog used in the jungle biome. |
|
||||
| minecraft:fog_jungle_edge | Fog used in the jungle edge biome. |
|
||||
| minecraft:fog_jungle_hills | Fog used in the jungle hills biome. |
|
||||
| minecraft:fog_jungle_mutated | Fog used in the mutated jungle biome. |
|
||||
| minecraft:fog_lukewarm_ocean | Fog used in the lukewarm ocean biome. |
|
||||
| minecraft:fog_mega_spruce_taiga | Fog used in the mega spruce taiga biome. |
|
||||
| minecraft:fog_mega_spruce_taiga_mutated | Fog used in the mega spruce mutated taiga biome. |
|
||||
| minecraft:fog_mega_taiga | Fog used in the mega taiga biome. |
|
||||
| minecraft:fog_mega_taiga_hills | Fog used in the mega taiga hills biome. |
|
||||
| minecraft:fog_mega_taiga_mutated | Fog used in the mega mutated taiga biome. |
|
||||
| minecraft:fog_mesa | Fog used in the mesa biome. |
|
||||
| minecraft:fog_mesa_bryce | Fog used in the mesa bryce biome. |
|
||||
| minecraft:fog_mesa_mutated | Fog used in the mutated mesa biome. |
|
||||
| minecraft:fog_mesa_plateau | Fog used in the mesa plateau biome. |
|
||||
| minecraft:fog_mesa_plateau_stone | Fog used in the stone mesa plateau biome. |
|
||||
| minecraft:fog_mushroom_island | Fog used in the mushroom island biome. |
|
||||
| minecraft:fog_mushroom_island_shore | Fog used in the mushroom island shore biome. |
|
||||
| minecraft:fog_ocean | Fog used in the ocean biome. |
|
||||
| minecraft:fog_plains | Fog used in the plains biome. |
|
||||
| minecraft:fog_river | Fog used in the river biome. |
|
||||
| minecraft:fog_roofed_forest | Fog used in the roofed forest biome. |
|
||||
| minecraft:fog_savanna | Fog used in the savanna biome. |
|
||||
| minecraft:fog_savanna_mutated | Fog used in the mutated savanna biome. |
|
||||
| minecraft:fog_savanna_plateau | Fog used in the savanna plateau biome. |
|
||||
| minecraft:fog_soulsand_valley | Fog used in the soulsand valley biome. Adds a dark green tint to the sky |
|
||||
| minecraft:fog_stone_beach | Fog used in the stone beach biome. |
|
||||
| minecraft:fog_sunflower_plains | Fog used in the sunflower plains biome. |
|
||||
| minecraft:fog_swampland | Fog used in the swamp biome. |
|
||||
| minecraft:fog_swampland_mutated | Fog used in the mutated swamp biome. |
|
||||
| minecraft:fog_taiga | Fog used in the taiga biome. |
|
||||
| minecraft:fog_taiga_hills | Fog used in the taiga hills biome. |
|
||||
| minecraft:fog_taiga_mutated | Fog used in the mutated taiga hills biome. |
|
||||
| minecraft:fog_the_end | Fog used in the end biome. Adds a black tint to the edge of the sky |
|
||||
| minecraft:fog_warm_ocean | Fog used in the warm ocean biome. |
|
||||
| minecraft:fog_warped_forest | Fog used in the warped forest biome. Adds a dark red tint to the edge of the sky |
|
||||
| minecraft:fog_bamboo_jungle | 竹林生物群系使用的雾效 |
|
||||
| minecraft:fog_bamboo_jungle_hills | 竹林丘陵生物群系使用的雾效 |
|
||||
| minecraft:fog_basalt_deltas | 玄武岩三角洲生物群系使用的雾效,为天空边缘添加灰红色调 |
|
||||
| minecraft:fog_beach | 沙滩生物群系使用的雾效 |
|
||||
| minecraft:fog_birch_forest | 桦木林生物群系使用的雾效 |
|
||||
| minecraft:fog_birch_forest_hills | 桦木林丘陵生物群系使用的雾效 |
|
||||
| minecraft:fog_cold_beach | 寒冷沙滩生物群系使用的雾效 |
|
||||
| minecraft:fog_cold_ocean | 寒冷海洋生物群系使用的雾效 |
|
||||
| minecraft:fog_cold_taiga | 寒冷针叶林生物群系使用的雾效 |
|
||||
| minecraft:fog_cold_taiga_hills | 寒冷针叶林丘陵生物群系使用的雾效 |
|
||||
| minecraft:fog_cold_taiga_mutated | 突变寒冷针叶林生物群系使用的雾效 |
|
||||
| minecraft:fog_crimson_forest | 绯红森林生物群系使用的雾效,为天空边缘添加红色调 |
|
||||
| minecraft:fog_deep_cold_ocean | 深层寒冷海洋生物群系使用的雾效 |
|
||||
| minecraft:fog_deep_frozen_ocean | 深层冰冻海洋生物群系使用的雾效 |
|
||||
| minecraft:fog_deep_lukewarm_ocean | 深层温水海洋生物群系使用的雾效 |
|
||||
| minecraft:fog_deep_ocean | 深层海洋生物群系使用的雾效 |
|
||||
| minecraft:fog_deep_warm_ocean | 深层温暖海洋生物群系使用的雾效 |
|
||||
| minecraft:fog_default | 游戏默认雾效 |
|
||||
| minecraft:fog_desert | 沙漠生物群系使用的雾效 |
|
||||
| minecraft:fog_desert_hills | 沙漠丘陵生物群系使用的雾效 |
|
||||
| minecraft:fog_extreme_hills | 峭壁生物群系使用的雾效 |
|
||||
| minecraft:fog_extreme_hills_edge | 峭壁边缘生物群系使用的雾效 |
|
||||
| minecraft:fog_extreme_hills_mutated | 突变峭壁生物群系使用的雾效 |
|
||||
| minecraft:fog_extreme_hills_plus_trees | 带树林的峭壁生物群系使用的雾效 |
|
||||
| minecraft:fog_extreme_hills_plus_trees_mutated | 突变带树林的峭壁生物群系使用的雾效 |
|
||||
| minecraft:fog_flower_forest | 繁花森林生物群系使用的雾效 |
|
||||
| minecraft:fog_forest | 森林生物群系使用的雾效 |
|
||||
| minecraft:fog_forest_hills | 森林丘陵生物群系使用的雾效 |
|
||||
| minecraft:fog_frozen_ocean | 冰冻海洋生物群系使用的雾效 |
|
||||
| minecraft:fog_frozen_river | 冰冻河流生物群系使用的雾效 |
|
||||
| minecraft:fog_hell | 下界荒地生物群系使用的雾效,为天空边缘添加红色调 |
|
||||
| minecraft:fog_ice_mountains | 冰封山脉生物群系使用的雾效 |
|
||||
| minecraft:fog_ice_plains | 冰原生物群系使用的雾效 |
|
||||
| minecraft:fog_ice_plains_spikes | 冰刺平原生物群系使用的雾效 |
|
||||
| minecraft:fog_jungle | 丛林生物群系使用的雾效 |
|
||||
| minecraft:fog_jungle_edge | 丛林边缘生物群系使用的雾效 |
|
||||
| minecraft:fog_jungle_hills | 丛林丘陵生物群系使用的雾效 |
|
||||
| minecraft:fog_jungle_mutated | 突变丛林生物群系使用的雾效 |
|
||||
| minecraft:fog_lukewarm_ocean | 温水海洋生物群系使用的雾效 |
|
||||
| minecraft:fog_mega_spruce_taiga | 巨型云杉针叶林生物群系使用的雾效 |
|
||||
| minecraft:fog_mega_spruce_taiga_mutated | 突变巨型云杉针叶林生物群系使用的雾效 |
|
||||
| minecraft:fog_mega_taiga | 巨型针叶林生物群系使用的雾效 |
|
||||
| minecraft:fog_mega_taiga_hills | 巨型针叶林丘陵生物群系使用的雾效 |
|
||||
| minecraft:fog_mega_taiga_mutated | 突变巨型针叶林生物群系使用的雾效 |
|
||||
| minecraft:fog_mesa | 平顶山生物群系使用的雾效 |
|
||||
| minecraft:fog_mesa_bryce | 布莱斯平顶山生物群系使用的雾效 |
|
||||
| minecraft:fog_mesa_mutated | 突变平顶山生物群系使用的雾效 |
|
||||
| minecraft:fog_mesa_plateau | 平顶山高原生物群系使用的雾效 |
|
||||
| minecraft:fog_mesa_plateau_stone | 石质平顶山高原生物群系使用的雾效 |
|
||||
| minecraft:fog_mushroom_island | 蘑菇岛生物群系使用的雾效 |
|
||||
| minecraft:fog_mushroom_island_shore | 蘑菇岛海岸生物群系使用的雾效 |
|
||||
| minecraft:fog_ocean | 海洋生物群系使用的雾效 |
|
||||
| minecraft:fog_plains | 平原生物群系使用的雾效 |
|
||||
| minecraft:fog_river | 河流生物群系使用的雾效 |
|
||||
| minecraft:fog_roofed_forest | 黑森林生物群系使用的雾效 |
|
||||
| minecraft:fog_savanna | 热带草原生物群系使用的雾效 |
|
||||
| minecraft:fog_savanna_mutated | 突变热带草原生物群系使用的雾效 |
|
||||
| minecraft:fog_savanna_plateau | 热带高原生物群系使用的雾效 |
|
||||
| minecraft:fog_soulsand_valley | 灵魂沙峡谷生物群系使用的雾效,为天空边缘添加深绿色调 |
|
||||
| minecraft:fog_stone_beach | 石滩生物群系使用的雾效 |
|
||||
| minecraft:fog_sunflower_plains | 向日葵平原生物群系使用的雾效 |
|
||||
| minecraft:fog_swampland | 沼泽生物群系使用的雾效 |
|
||||
| minecraft:fog_swampland_mutated | 突变沼泽生物群系使用的雾效 |
|
||||
| minecraft:fog_taiga | 针叶林生物群系使用的雾效 |
|
||||
| minecraft:fog_taiga_hills | 针叶林丘陵生物群系使用的雾效 |
|
||||
| minecraft:fog_taiga_mutated | 突变针叶林丘陵生物群系使用的雾效 |
|
||||
| minecraft:fog_the_end | 末地生物群系使用的雾效,为天空边缘添加黑色调 |
|
||||
| minecraft:fog_warm_ocean | 温暖海洋生物群系使用的雾效 |
|
||||
| minecraft:fog_warped_forest | 诡异森林生物群系使用的雾效,为天空边缘添加深红色调 |
|
||||
|
||||
[Original Credit](https://www.youtube.com/watch?time_continue=52&v=SA79ulIgypg&feature=emb_logo)
|
||||
[原始来源](https://www.youtube.com/watch?time_continue=52&v=SA79ulIgypg&feature=emb_logo)
|
||||
|
||||
|
||||
## Auto-generated
|
||||
## 自动生成列表
|
||||
|
||||
<!-- page_dumper_start -->
|
||||
| ID | Biome used in |
|
||||
| ID | 适用的生物群系 |
|
||||
| ---------------------------------------------- | -------------------------------- |
|
||||
| minecraft:fog_bamboo_jungle | bamboo_jungle |
|
||||
| minecraft:fog_bamboo_jungle_hills | bamboo_jungle_hills |
|
||||
@@ -159,5 +162,5 @@ mentions:
|
||||
| minecraft:fog_the_end | the_end |
|
||||
| minecraft:fog_warm_ocean | warm_ocean |
|
||||
| minecraft:fog_warped_forest | warped_forest |
|
||||
*Last updated for 1.20.10*
|
||||
<!-- page_dumper_end -->
|
||||
*最后更新于1.20.10版本*
|
||||
<!-- page_dumper_end -->
|
||||
@@ -1,3 +1,3 @@
|
||||
---
|
||||
title: Documentation
|
||||
title: 文档
|
||||
---
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
---
|
||||
title: Vanilla Materials
|
||||
title: 原版材质
|
||||
show_toc: false
|
||||
tags:
|
||||
- expert
|
||||
- 专家
|
||||
mentions:
|
||||
- SirLich
|
||||
- Luthorius
|
||||
@@ -11,15 +11,19 @@ mentions:
|
||||
- ThomasOrs
|
||||
---
|
||||
|
||||
# 原版材质
|
||||
|
||||
<!--@include: @/wiki/bedrock-wiki-mirror.md-->
|
||||
|
||||
:::warning
|
||||
Materials are not for the faint of heart. Be prepared for potential crashes, content log errors, and long loading times.
|
||||
材质系统不适合心理承受能力较弱者。请做好应对潜在崩溃、内容日志错误和漫长加载时间的准备。
|
||||
:::
|
||||
|
||||
Materials are extremely useful for making entities more unique. You can make new ones for your addons, or use pre-existing vanilla materials.
|
||||
材质在使实体更具独特性方面极为有用。您既可以为附加包创建新材质,也可以使用现有的原版材质。
|
||||
|
||||
You can learn more about creating materials [here](/visuals/materials).
|
||||
您可以通过[此链接](/wiki/visuals/materials)了解更多关于材质创建的内容。
|
||||
|
||||
## List of Vanilla Materials
|
||||
## 原版材质列表
|
||||
|
||||
| Vanilla_Material |
|
||||
| --------------------------------------------------------------------------------------- |
|
||||
@@ -81,339 +85,264 @@ You can learn more about creating materials [here](/visuals/materials).
|
||||
| [opaque_block_color](#opaque-block-color) |
|
||||
| [opaque_block_color_uv2](#opaque-block-color-uv2) |
|
||||
|
||||
## Properties
|
||||
## 材质属性
|
||||
|
||||
Materials can have a range of different properties which affect their appearance, including:
|
||||
材质可具备多种影响外观的属性,包括:
|
||||
|
||||
### Backface-Culling
|
||||
### 背面剔除(Backface-Culling)
|
||||
使模型的内表面不被渲染。
|
||||
|
||||
This makes the inside faces of models **not** render.
|
||||
### Alpha通道
|
||||
启用半透明效果,使用纹理的Alpha通道。
|
||||
|
||||
### Alpha Channel
|
||||
### 自发光(Emissive)
|
||||
使纹理不受暗光影响,呈现发光效果。若使用Alpha通道,每个像素的发光强度与其透明度成正比。
|
||||
|
||||
Enables analogue translucency, usage of the alpha channel of textures.
|
||||
### 固定透明度(Set Translucency)
|
||||
无论其他属性如何,始终以预设透明度完全渲染。
|
||||
|
||||
### Emissive
|
||||
### 纹理混合(Texture Blending)
|
||||
当存在多个纹理时,可根据纹理通过某种滤镜改变实体外观。
|
||||
|
||||
Causes the texture to not be affected by dim lighting, and appear to glow. If there is usage of the alpha channel, the emissivity is in direct proportion to how transparent each individual pixel is.
|
||||
## 材质细节说明
|
||||
|
||||
### Set Translucency
|
||||
|
||||
Regardless of other properties, is always completely rendered at a pre-determined translucency.
|
||||
|
||||
### Texture Blending
|
||||
|
||||
When multiple textures are present, may use a filter of sorts to change the entities appearance, based on the textures.
|
||||
|
||||
## Details on the Materials
|
||||
|
||||
The following is a last of each material, along with general known properties. The names are vague pointers to what each will do, some may act rather unpredictably, or have undocumented usages, so this only is what's certain for each:
|
||||
以下是各材质的具体说明及已知属性。材质名称仅作功能提示,部分材质可能表现不稳定或存在未记录的用法,以下信息仅包含已验证内容:
|
||||
|
||||
:::warning
|
||||
The following section has currently **only** been tested for with single textures. Take it all with a pinch of salt. It is highly recommended to experiment with the materials yourself.
|
||||
以下内容目前**仅针对单纹理**进行过测试,请谨慎参考。强烈建议自行实验材质效果。
|
||||
:::
|
||||
|
||||
### alpha_block
|
||||
|
||||
- Backface-culling
|
||||
- Completely Opaque
|
||||
- 背面剔除
|
||||
- 完全不透明
|
||||
|
||||
### alpha_block_color
|
||||
|
||||
- Backface-Culling
|
||||
- Translucencies as Transparent
|
||||
- 背面剔除
|
||||
- 透明度处理为半透明
|
||||
|
||||
### banner
|
||||
|
||||
Inconsistently renders objects with transparency behind.
|
||||
|
||||
- N/A
|
||||
在透明物体后方渲染时表现不稳定
|
||||
- 无特殊属性
|
||||
|
||||
### banner_pole
|
||||
|
||||
Inconsistently renders objects with transparency behind.
|
||||
|
||||
- Backface-Culling
|
||||
- Transparency
|
||||
在透明物体后方渲染时表现不稳定
|
||||
- 背面剔除
|
||||
- 透明效果
|
||||
|
||||
### beacon_beam
|
||||
|
||||
- Completely Opaque
|
||||
- 完全不透明
|
||||
|
||||
### beacon_beam_transparent
|
||||
|
||||
This one is rather different. Particles that are behind it are rendered in front, and it appears to have "Frontface-Culling".
|
||||
|
||||
- Alpha Channel
|
||||
特性特殊:后方粒子会渲染在前方,呈现"正面剔除"效果
|
||||
- Alpha通道
|
||||
|
||||
### charged_creeper
|
||||
|
||||
Inconsistently renders objects with transparency behind.
|
||||
|
||||
- Emissive
|
||||
- Set Translucency
|
||||
在透明物体后方渲染时表现不稳定
|
||||
- 自发光
|
||||
- 固定透明度
|
||||
|
||||
### conduit_wind
|
||||
|
||||
- Transparency
|
||||
- Translucency as Transparency
|
||||
- 透明效果
|
||||
- 透明度处理为半透明
|
||||
|
||||
### entity
|
||||
|
||||
- Completely Opaque
|
||||
- Backface Culling
|
||||
- 完全不透明
|
||||
- 背面剔除
|
||||
|
||||
### entity_alphablend
|
||||
|
||||
Inconsistently renders objects with transparency behind.
|
||||
|
||||
- Backface-Culling
|
||||
- Alpha Channel
|
||||
在透明物体后方渲染时表现不稳定
|
||||
- 背面剔除
|
||||
- Alpha通道
|
||||
|
||||
### entity_alphablend_nocolorentity_static
|
||||
|
||||
- Unknown
|
||||
- Potential Crash
|
||||
- 未知属性
|
||||
- 可能导致崩溃
|
||||
|
||||
### entity_alphatest
|
||||
|
||||
- Transparency
|
||||
- Translucency as Transparency
|
||||
- 透明效果
|
||||
- 透明度处理为半透明
|
||||
|
||||
### entity_alphatest_change_color
|
||||
|
||||
- Transparency
|
||||
- Translucency as Opaque
|
||||
- 透明效果
|
||||
- 透明度处理为不透明
|
||||
|
||||
### entity_alphatest_change_color_glint
|
||||
|
||||
- Unknown
|
||||
- 未知属性
|
||||
|
||||
### entity_alphatest_glint
|
||||
|
||||
- Unknown
|
||||
- 未知属性
|
||||
|
||||
### entity_alphatest_glint_item
|
||||
|
||||
- Unknown
|
||||
- 未知属性
|
||||
|
||||
### entity_alphatest_multicolor_tint
|
||||
|
||||
- Greyscale
|
||||
- Backface-Culling
|
||||
- Transparency
|
||||
- Translucency as Opaque
|
||||
- 灰度处理
|
||||
- 背面剔除
|
||||
- 透明效果
|
||||
- 透明度处理为不透明
|
||||
|
||||
### entity_beam
|
||||
|
||||
- Transparency
|
||||
- Translucency as Transparency
|
||||
- 透明效果
|
||||
- 透明度处理为半透明
|
||||
|
||||
### entity_beam_additive
|
||||
|
||||
Particles always render on top
|
||||
|
||||
- Transparency
|
||||
- Emissive
|
||||
- Backface-Culling
|
||||
- Set Translucency
|
||||
粒子始终渲染在最上层
|
||||
- 透明效果
|
||||
- 自发光
|
||||
- 背面剔除
|
||||
- 固定透明度
|
||||
|
||||
### entity_change_color
|
||||
|
||||
- Completely Opaque
|
||||
- 完全不透明
|
||||
|
||||
### entity_change_color_glint
|
||||
|
||||
- Unknown
|
||||
- 未知属性
|
||||
|
||||
### entity_custom
|
||||
|
||||
Inconsistently renders objects with transparency behind.
|
||||
|
||||
- Backface-Culling
|
||||
- Alpha Channel
|
||||
在透明物体后方渲染时表现不稳定
|
||||
- 背面剔除
|
||||
- Alpha通道
|
||||
|
||||
### entity_dissolve_layer0
|
||||
|
||||
Inconsistently renders objects with transparency behind.
|
||||
|
||||
- Unknown
|
||||
在透明物体后方渲染时表现不稳定
|
||||
- 未知属性
|
||||
|
||||
### entity_dissolve_layer1
|
||||
|
||||
- Unknown
|
||||
- 未知属性
|
||||
|
||||
### entity_emissive
|
||||
|
||||
- Emissive
|
||||
- Completely Opaque
|
||||
- Backface-Culling
|
||||
- 自发光
|
||||
- 完全不透明
|
||||
- 背面剔除
|
||||
|
||||
### entity_emissive_alpha
|
||||
|
||||
- Emissive
|
||||
- Alpha Channel
|
||||
- Transparency
|
||||
- 自发光
|
||||
- Alpha通道
|
||||
- 透明效果
|
||||
|
||||
### entity_emissive_alpha_one_sided
|
||||
|
||||
- Emissive
|
||||
- Alpha Channel
|
||||
- Transparency
|
||||
- Backface-Culling
|
||||
- 自发光
|
||||
- Alpha通道
|
||||
- 透明效果
|
||||
- 背面剔除
|
||||
|
||||
### entity_flat_color_line
|
||||
|
||||
- Backface-Culling
|
||||
- Completely Opaque
|
||||
- 背面剔除
|
||||
- 完全不透明
|
||||
|
||||
### entity_glint
|
||||
|
||||
- Unknown
|
||||
- 未知属性
|
||||
|
||||
### entity_lead_base
|
||||
|
||||
Inconsistently renders objects with transparency behind.
|
||||
|
||||
- Alpha Channel
|
||||
在透明物体后方渲染时表现不稳定
|
||||
- Alpha通道
|
||||
|
||||
### entity_loyalty_rope
|
||||
|
||||
- Unknown
|
||||
- 未知属性
|
||||
|
||||
### entity_multitexture
|
||||
|
||||
- Unknown
|
||||
- 未知属性
|
||||
|
||||
### entity_multitexture_alpha_test
|
||||
|
||||
- Unknown
|
||||
- 未知属性
|
||||
|
||||
### entity_multitexture_alpha_test_color_mask
|
||||
|
||||
- Unknown
|
||||
- 未知属性
|
||||
|
||||
### entity_multitexture_color_mask
|
||||
|
||||
- Unknown
|
||||
- 未知属性
|
||||
|
||||
### entity_multitexture_masked
|
||||
|
||||
- Unknown
|
||||
- 未知属性
|
||||
|
||||
### entity_multitexture_multiplicative_blend
|
||||
|
||||
- Unknown
|
||||
- 未知属性
|
||||
|
||||
### entity_nocull
|
||||
|
||||
- Completely Opaque
|
||||
- 完全不透明
|
||||
|
||||
### guardian_ghost
|
||||
|
||||
Inconsistently renders objects with transparency behind.
|
||||
|
||||
- Backface-Culling
|
||||
- Alpha Channel
|
||||
在透明物体后方渲染时表现不稳定
|
||||
- 背面剔除
|
||||
- Alpha通道
|
||||
|
||||
### item_in_hand
|
||||
|
||||
- Completely Opaque
|
||||
- Backface-Culling
|
||||
- 完全不透明
|
||||
- 背面剔除
|
||||
|
||||
### item_in_hand_entity_alphatest
|
||||
|
||||
- Transparency
|
||||
- Translucency into either Opaque or Transparent depends on level.
|
||||
- 透明效果
|
||||
- 根据透明度等级决定是否透明
|
||||
|
||||
### item_in_hand_entity_alphatest_color
|
||||
|
||||
- Transparency
|
||||
- Translucency into either Opaque or Transparent depends on level.
|
||||
- 透明效果
|
||||
- 根据透明度等级决定是否透明
|
||||
|
||||
### item_in_hand_glint
|
||||
|
||||
- Unknown
|
||||
- 未知属性
|
||||
|
||||
### item_in_hand_multicolor_tint
|
||||
|
||||
- Greyscale
|
||||
- Completely Opaque
|
||||
- Backface-Culling
|
||||
- 灰度处理
|
||||
- 完全不透明
|
||||
- 背面剔除
|
||||
|
||||
### map
|
||||
|
||||
- Transparency
|
||||
- Translucency into either Opaque or Transparent depends on level.
|
||||
- 透明效果
|
||||
- 根据透明度等级决定是否透明
|
||||
|
||||
### map_decoration
|
||||
|
||||
- Backface-Culling
|
||||
- Transparency
|
||||
- Translucency into either Opaque or Transparent depends on level.
|
||||
- 背面剔除
|
||||
- 透明效果
|
||||
- 根据透明度等级决定是否透明
|
||||
|
||||
### map_marker
|
||||
|
||||
- Backface-Culling
|
||||
- Transparency
|
||||
- Translucency into either Opaque or Transparent depends on level.
|
||||
- Potential Crash
|
||||
- 背面剔除
|
||||
- 透明效果
|
||||
- 根据透明度等级决定是否透明
|
||||
- 可能导致崩溃
|
||||
|
||||
### moving_block
|
||||
|
||||
- Completely Opaque
|
||||
- Backface-Culling
|
||||
- 完全不透明
|
||||
- 背面剔除
|
||||
|
||||
### moving_block_alpha
|
||||
|
||||
- Backface-Culling
|
||||
- Transparency
|
||||
- Translucency into either Opaque or Transparent depends on level.
|
||||
- 背面剔除
|
||||
- 透明效果
|
||||
- 根据透明度等级决定是否透明
|
||||
|
||||
### moving_block_alpha_seasons
|
||||
|
||||
- Translucency into either Opaque or Transparent depends on level.
|
||||
- Transparency
|
||||
- 根据透明度等级决定是否透明
|
||||
- 透明效果
|
||||
|
||||
### moving_block_alpha_single_side
|
||||
|
||||
- Backface-Culling
|
||||
- Transparency
|
||||
- Translucency into either Opaque or Transparent depends on level.
|
||||
- 背面剔除
|
||||
- 透明效果
|
||||
- 根据透明度等级决定是否透明
|
||||
|
||||
### moving_block_blend
|
||||
|
||||
Inconsistently renders objects with transparency behind.
|
||||
|
||||
- Backface-Culling
|
||||
- Alpha Channel
|
||||
在透明物体后方渲染时表现不稳定
|
||||
- 背面剔除
|
||||
- Alpha通道
|
||||
|
||||
### moving_block_double_side
|
||||
|
||||
- Completely Opaque
|
||||
- 完全不透明
|
||||
|
||||
### moving_block_seasons
|
||||
|
||||
- Completely Opaque
|
||||
- Backface-Culling
|
||||
- 完全不透明
|
||||
- 背面剔除
|
||||
|
||||
### opaque_block
|
||||
|
||||
- Completely Opaque
|
||||
- Backface-Culling
|
||||
- 完全不透明
|
||||
- 背面剔除
|
||||
|
||||
### opaque_block_color
|
||||
|
||||
- Completely Opaque
|
||||
- Backface-Culling
|
||||
- 完全不透明
|
||||
- 背面剔除
|
||||
|
||||
### opaque_block_color_uv2
|
||||
|
||||
- Completely Opaque
|
||||
- Backface-Culling
|
||||
|
||||
- 完全不透明
|
||||
- 背面剔除
|
||||
|
||||
:::warning
|
||||
Please note, that these have also only been tested using a RenderDragon platform. Non-RenderDragon visuals may differ.
|
||||
:::
|
||||
|
||||
请注意,以上测试结果均基于RenderDragon渲染平台。非RenderDragon的视觉效果可能存在差异。
|
||||
:::
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: Pack Folder Structure
|
||||
title: 包文件夹结构
|
||||
show_toc: false
|
||||
mentions:
|
||||
- SirLich
|
||||
@@ -12,6 +12,10 @@ mentions:
|
||||
- SmokeyStack
|
||||
---
|
||||
|
||||
# 包文件夹结构
|
||||
|
||||
<!--@include: @/wiki/bedrock-wiki-mirror.md-->
|
||||
|
||||
<FolderView :paths="[
|
||||
'BP/manifest.json',
|
||||
'BP/pack_icon.png',
|
||||
@@ -32,7 +36,7 @@ mentions:
|
||||
'BP/scripts/exampleScript.js',
|
||||
'BP/spawn_rules/example.spawn.json',
|
||||
'BP/texts/languages.json',
|
||||
'BP/texts/\*.lang',
|
||||
'BP/texts/*.lang',
|
||||
'BP/trading/example.trade.json',
|
||||
'BP/trading/economy_trades/example.trade.json',
|
||||
'BP/structures/example.mcstructure',
|
||||
@@ -92,9 +96,9 @@ mentions:
|
||||
'RP/texts/zh_TW.lang',
|
||||
'RP/texts/zh_TW.lang',
|
||||
'RP/texts/ja_JP/font/glyph_2E.png',
|
||||
'RP/texts/ja_JP/font/\*.png',
|
||||
'RP/texts/ja_JP/font/*.png',
|
||||
'RP/texts/zh_TW/font/glyph_2E.png',
|
||||
'RP/texts/zh_TW/font/\*.png',
|
||||
'RP/texts/zh_TW/font/*.png',
|
||||
'RP/textures/item_texture.json',
|
||||
'RP/textures/terrain_texture.json',
|
||||
'RP/textures/flipbook_textures.json',
|
||||
@@ -109,5 +113,5 @@ mentions:
|
||||
'RP/textures/entity/example.png',
|
||||
'RP/textures/items/example.png',
|
||||
'RP/textures/particle/example.png',
|
||||
'RP/ui/\*.json'
|
||||
]"></FolderView>
|
||||
'RP/ui/*.json'
|
||||
]"></FolderView>
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: Projectiles
|
||||
title: 投射物
|
||||
mentions:
|
||||
- SirLich
|
||||
- stirante
|
||||
@@ -9,248 +9,250 @@ mentions:
|
||||
- ThomasOrs
|
||||
---
|
||||
|
||||
## Overview
|
||||
# 投射物
|
||||
|
||||
This page intends to document all different fields you can use inside `minecraft:projectile` entity behavior component.
|
||||
<!--@include: @/wiki/bedrock-wiki-mirror.md-->
|
||||
|
||||
## 概述
|
||||
|
||||
本文档旨在记录`minecraft:projectile`实体行为组件中可使用的所有字段。
|
||||
|
||||
:::warning
|
||||
_Disclaimer: this component has been mostly documented based on projectiles found in the game or reverse engineering the game._
|
||||
_This information was last tested on **1.18.2**._
|
||||
_免责声明:该组件的文档主要基于游戏中存在的投射物或通过逆向工程获得。_
|
||||
_最后测试版本为 **1.18.2**。_
|
||||
:::
|
||||
|
||||
| Name | Type | Default Value | Description |
|
||||
| ------------------------- | ---------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| anchor | Integer | | |
|
||||
| angle_offset | Decimal | 0 | Determines the angle at which the projectile is thrown |
|
||||
| catch_fire | Boolean | false | If true, the entity hit will be set on fire |
|
||||
| crit_particle_on_hurt | Boolean | false | If true, the projectile will produce critical hit particles when it happens |
|
||||
| destroy_on_hurt | Boolean | false | If true, this entity will be destroyed when hit |
|
||||
| filter | String | | Entity Definitions defined here can't be hurt by the projectile |
|
||||
| fire_affected_by_griefing | Boolean | false | If true, whether the projectile causes fire is affected by the mob griefing game rule |
|
||||
| gravity | Decimal | 0.05 | The gravity applied to this entity when thrown. The higher the value, the faster the entity falls |
|
||||
| hit_ground_sound | String | | The sound that plays when the projectile hits ground |
|
||||
| hit_sound | String | | The sound that plays when the projectile hits an entity |
|
||||
| homing | Boolean | false | If true, the projectile homes in to the nearest. **Does not work on 1.18.2** entity |
|
||||
| inertia | Decimal | 0.99 | The fraction of the projectile's speed maintained every frame while traveling in air |
|
||||
| is_dangerous | Boolean | false | If true, the projectile will be treated as dangerous to the players |
|
||||
| knockback | Boolean | true | If true, the projectile will knock back the entity it hits |
|
||||
| lightning | Boolean | false | If true, the entity hit will be struck by lightning |
|
||||
| liquid_inertia | Decimal | 0.6 | The fraction of the projectile's speed maintained every frame while traveling in water |
|
||||
| multiple_targets | Boolean | true | If true, the projectile can hit multiple entities per flight |
|
||||
| offset | Vector [a, b, c] | [0, 0.5, 0] | The offset from the entity's anchor where the projectile will spawn |
|
||||
| on_fire_time | Decimal | 5 | Time in seconds that the entity hit will be on fire for |
|
||||
| on_hit | Object | | Projectile's behavior on hit. More info [below](#on_hit) |
|
||||
| particle | String | iconcrack | Particle to use upon collision |
|
||||
| potion_effect | Integer | -1 | Defines the effect the arrow will apply to the entity it hits |
|
||||
| power | Decimal | 1.3 | Determines the velocity of the projectile |
|
||||
| reflect_on_hurt | Boolean | false | If true, this entity will be reflected back when hit |
|
||||
| semi_random_diff_damage | Boolean | false | If true, damage will be randomized based on damage and speed |
|
||||
| shoot_sound | String | | The sound that plays when the projectile is shot |
|
||||
| shoot_target | Boolean | true | If true, the projectile will be shot towards the target of the entity firing it |
|
||||
| should_bounce | Boolean | false | If true, the projectile will bounce upon hit |
|
||||
| splash_potion | Boolean | false | If true, the projectile will be treated like a splash potion |
|
||||
| splash_range | Decimal | 4 | Radius in blocks of the 'splash' effect |
|
||||
| stop_on_hurt | Boolean | | |
|
||||
| uncertainty_base | Decimal | 0 | The base accuracy. Accuracy is determined by the formula uncertaintyBase - difficultyLevel \* uncertaintyMultiplier |
|
||||
| uncertainty_multiplier | Decimal | 0 | Determines how much difficulty affects accuracy. Accuracy is determined by the formula uncertaintyBase - difficultyLevel \* uncertaintyMultiplier |
|
||||
| hit_water | Boolean | false | If true, liquid blocks will be treated as solid. **Requires "Education Edition" toggle active** |
|
||||
| 字段名称 | 类型 | 默认值 | 描述 |
|
||||
| ------------------------- | ----------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| anchor | 整数 | | |
|
||||
| angle_offset | 小数 | 0 | 决定投射物被抛射时的角度 |
|
||||
| catch_fire | 布尔值 | false | 若为true,被击中的实体将被点燃 |
|
||||
| crit_particle_on_hurt | 布尔值 | false | 若为true,投射物在造成暴击时会产生特殊粒子效果 |
|
||||
| destroy_on_hurt | 布尔值 | false | 若为true,投射物在击中时会被销毁 |
|
||||
| filter | 字符串 | | 此处定义的实体类型不会被投射物伤害 |
|
||||
| fire_affected_by_griefing | 布尔值 | false | 若为true,投射物的引燃效果受游戏规则"mobGriefing"影响 |
|
||||
| gravity | 小数 | 0.05 | 投射物抛射时应用的引力值。数值越大下坠越快 |
|
||||
| hit_ground_sound | 字符串 | | 投射物击中地面时播放的音效 |
|
||||
| hit_sound | 字符串 | | 投射物击中实体时播放的音效 |
|
||||
| homing | 布尔值 | false | 若为true,投射物会自动追踪最近目标。**在1.18.2版本中不可用** |
|
||||
| inertia | 小数 | 0.99 | 投射物在空气中飞行时每帧保留的速度比例 |
|
||||
| is_dangerous | 布尔值 | false | 若为true,投射物将被视为对玩家具有威胁性 |
|
||||
| knockback | 布尔值 | true | 若为true,投射物会击退被击中的实体 |
|
||||
| lightning | 布尔值 | false | 若为true,被击中的实体将遭受雷击 |
|
||||
| liquid_inertia | 小数 | 0.6 | 投射物在水中飞行时每帧保留的速度比例 |
|
||||
| multiple_targets | 布尔值 | true | 若为true,投射物在飞行过程中可以击中多个实体 |
|
||||
| offset | 三维向量 [a,b,c] | [0, 0.5, 0] | 投射物生成时相对于实体锚点的偏移量 |
|
||||
| on_fire_time | 小数 | 5 | 被击中实体持续燃烧的时间(秒) |
|
||||
| on_hit | 对象 | | 投射物击中时的行为。详见[下方说明](#on_hit) |
|
||||
| particle | 字符串 | iconcrack | 碰撞时使用的粒子效果 |
|
||||
| potion_effect | 整数 | -1 | 定义箭矢击中实体时施加的药水效果 |
|
||||
| power | 小数 | 1.3 | 决定投射物的初速度 |
|
||||
| reflect_on_hurt | 布尔值 | false | 若为true,投射物被击中时会反弹 |
|
||||
| semi_random_diff_damage | 布尔值 | false | 若为true,伤害值将基于基础伤害和速度进行随机计算 |
|
||||
| shoot_sound | 字符串 | | 投射物发射时播放的音效 |
|
||||
| shoot_target | 布尔值 | true | 若为true,投射物将朝向发射者的目标方向射出 |
|
||||
| should_bounce | 布尔值 | false | 若为true,投射物击中时会反弹 |
|
||||
| splash_potion | 布尔值 | false | 若为true,投射物将被视为喷溅药水 |
|
||||
| splash_range | 小数 | 4 | '溅射'效果的半径(方块) |
|
||||
| stop_on_hurt | 布尔值 | | |
|
||||
| uncertainty_base | 小数 | 0 | 基础精准度。实际精准度计算公式为:uncertaintyBase - difficultyLevel \* uncertaintyMultiplier |
|
||||
| uncertainty_multiplier | 小数 | 0 | 难度对精准度的影响系数。实际精准度计算公式为:uncertaintyBase - difficultyLevel \* uncertaintyMultiplier |
|
||||
| hit_water | 布尔值 | false | 若为true,液态方块将被视为固体。**需要启用"教育版"功能** |
|
||||
|
||||
## on_hit
|
||||
|
||||
This object contains all behaviors, that can be executed, when projectile hits something.
|
||||
该对象包含投射物击中目标时可执行的所有行为。
|
||||
|
||||
### arrow_effect
|
||||
|
||||
_Exact behavior unknown_
|
||||
_具体作用未知_
|
||||
|
||||
### teleport_owner
|
||||
|
||||
Teleports shooter to the hit location.
|
||||
将发射者传送到击中位置。
|
||||
|
||||
### catch_fire
|
||||
|
||||
_Exact behavior unknown_
|
||||
|
||||
Sets target on fire
|
||||
_具体作用未知_
|
||||
点燃目标
|
||||
|
||||
### ignite
|
||||
|
||||
_Exact behavior unknown_
|
||||
|
||||
Sets target on fire
|
||||
_具体作用未知_
|
||||
点燃目标
|
||||
|
||||
### remove_on_hit
|
||||
|
||||
Removes the projectile when it hits something.
|
||||
击中目标后移除投射物。
|
||||
|
||||
### douse_fire
|
||||
|
||||
_Exact behavior unknown_
|
||||
_具体作用未知_
|
||||
|
||||
### impact_damage
|
||||
|
||||
Deals damage on hit.
|
||||
造成碰撞伤害。
|
||||
|
||||
| Name | Type | Description |
|
||||
| ------------------------------ | -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
|
||||
| damage | Integer/Integer Array [min, max] | Damage dealt to entity on hit |
|
||||
| semi_random_diff_damage | Boolean | |
|
||||
| max_critical_damage | Decimal | |
|
||||
| min_critical_damage | Decimal | |
|
||||
| power_multiplier | Decimal | |
|
||||
| channeling | Boolean | |
|
||||
| set_last_hurt_requires_damage | Boolean | |
|
||||
| destroy_on_hit_requires_damage | Boolean | |
|
||||
| filter | String | Entity to affect. Much more primitive than filters used elsewhere, as it cannot "test" for anything other than an identifier |
|
||||
| destroy_on_hit | Boolean | |
|
||||
| knockback | Boolean | |
|
||||
| catch_fire | Boolean | Dictates wether or not targets will be engulfed in flames |
|
||||
| 字段名称 | 类型 | 描述 |
|
||||
| ------------------------------ | --------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
|
||||
| damage | 整数/整数数组 [min, max] | 对实体造成的伤害值 |
|
||||
| semi_random_diff_damage | 布尔值 | |
|
||||
| max_critical_damage | 小数 | |
|
||||
| min_critical_damage | 小数 | |
|
||||
| power_multiplier | 小数 | |
|
||||
| channeling | 布尔值 | |
|
||||
| set_last_hurt_requires_damage | 布尔值 | |
|
||||
| destroy_on_hit_requires_damage | 布尔值 | |
|
||||
| filter | 字符串 | 受影响的实体类型。此过滤器较为基础,只能通过标识符进行匹配 |
|
||||
| destroy_on_hit | 布尔值 | |
|
||||
| knockback | 布尔值 | |
|
||||
| catch_fire | 布尔值 | 控制是否点燃目标 |
|
||||
|
||||
### definition_event
|
||||
|
||||
Calls an event on hit.
|
||||
触发击中事件。
|
||||
|
||||
| Name | Type | Description |
|
||||
| ------------------ | ------- | --------------------------------------------------- |
|
||||
| affect_projectile | Boolean | Event will be triggered for projectile entity |
|
||||
| affect_shooter | Boolean | Event will be triggered for shooter entity |
|
||||
| affect_target | Boolean | Event will be triggered for hit entity |
|
||||
| affect_splash_area | Boolean | Event will be triggered for all entities in an area |
|
||||
| splash_area | Decimal | Area of entities |
|
||||
| event_trigger | Object | Event to trigger. Structure below. |
|
||||
| 字段名称 | 类型 | 描述 |
|
||||
| ---------------------- | -------- | ------------------------------------------- |
|
||||
| affect_projectile | 布尔值 | 为投射物实体触发事件 |
|
||||
| affect_shooter | 布尔值 | 为发射者实体触发事件 |
|
||||
| affect_target | 布尔值 | 为被击中实体触发事件 |
|
||||
| affect_splash_area | 布尔值 | 为区域内所有实体触发事件 |
|
||||
| splash_area | 小数 | 实体作用范围半径 |
|
||||
| event_trigger | 对象 | 要触发的事件。结构如下: |
|
||||
|
||||
| Name | Type | Description |
|
||||
| ------- | ------ | ------------------------------------- |
|
||||
| event | String | Event to trigger |
|
||||
| target | String | Target of the event |
|
||||
| filters | Object | Criteria required in order to trigger |
|
||||
| 字段名称 | 类型 | 描述 |
|
||||
| ----------- | -------- | ----------------------------- |
|
||||
| event | 字符串 | 要触发的事件名称 |
|
||||
| target | 字符串 | 事件目标 |
|
||||
| filters | 对象 | 触发事件所需的过滤条件 |
|
||||
|
||||
### stick_in_ground
|
||||
|
||||
Sticks the projectile into the ground.
|
||||
将投射物插入地面。
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---------- | ------- | ----------- |
|
||||
| shake_time | Decimal | |
|
||||
| 字段名称 | 类型 | 描述 |
|
||||
| -------------- | -------- | ---- |
|
||||
| shake_time | 小数 | |
|
||||
|
||||
### spawn_aoe_cloud
|
||||
|
||||
Spawns an area of effect cloud of potion effect.
|
||||
生成药水效果的区域云。
|
||||
|
||||
| Name | Type | Description |
|
||||
| ------------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| radius | Decimal | Radius of the cloud |
|
||||
| radius_on_use | Decimal | |
|
||||
| potion | Integer | Lingering Potion ID |
|
||||
| particle | String | [Vanilla Particles](/particles/vanilla-particles) emitter of the cloud. Only accepts Vanilla Particles. **dragonbreath** enables the usage of Bottles to obtain Dragon's Breath. |
|
||||
| duration | Integer | Duration of the cloud in seconds |
|
||||
| color | Integer array [r, g, b] | Color of the particles |
|
||||
| affect_owner | Boolean | Is potion effect affecting the shooter. Does not appear to apply to the player |
|
||||
| reapplication_delay | Integer | Delay in ticks between application of the potion effect |
|
||||
| 字段名称 | 类型 | 描述 |
|
||||
| ----------------------- | ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| radius | 小数 | 云效果半径 |
|
||||
| radius_on_use | 小数 | |
|
||||
| potion | 整数 | 滞留药水ID |
|
||||
| particle | 字符串 | 区域云的[原版粒子效果](/wiki/particles/vanilla-particles)。仅接受原版粒子。**dragonbreath**允许使用瓶子收集龙息 |
|
||||
| duration | 整数 | 云效果持续时间(秒) |
|
||||
| color | 整数数组 [r, g, b] | 粒子颜色 |
|
||||
| affect_owner | 布尔值 | 药水效果是否影响发射者(对玩家无效) |
|
||||
| reapplication_delay | 整数 | 药水效果重复施加的时间间隔(刻) |
|
||||
|
||||
#### Potion IDs
|
||||
#### 药水ID
|
||||
|
||||
| Potion | Regular | Extended | Enhanced (Level II) |
|
||||
| ------------------------- | ------- | -------- | ------------------- |
|
||||
| Water Bottle | 0 | | |
|
||||
| Mundane Potion | 1 | 2 | |
|
||||
| Thick Potion | 3 | | |
|
||||
| Awkward Potion | 4 | | |
|
||||
| Potion of Night Vision | 5 | 6 | |
|
||||
| Potion of Invisibility | 7 | 8 | |
|
||||
| Potion of Leaping | 9 | 10 | 11 |
|
||||
| Potion of Fire Resistance | 12 | 13 | |
|
||||
| Potion of Swiftness | 14 | 15 | 16 |
|
||||
| Potion of Slowness | 17 | 18 | |
|
||||
| Potion of Water Breathing | 19 | 20 | |
|
||||
| Potion of Healing | 21 | | 22 |
|
||||
| Potion of Harming | 23 | | 24 |
|
||||
| Potion of Poison | 25 | 26 | 27 |
|
||||
| Potion of Regeneration | 28 | 29 | 30 |
|
||||
| Potion of Strength | 31 | 32 | 33 |
|
||||
| Potion of Weakness | 34 | 35 | |
|
||||
| Potion of Decay | 36 | | |
|
||||
| Potion of Turtle Master | 37 | 38 | 39 |
|
||||
| Potion of Slow Falling | 40 | 41 | |
|
||||
| Potion of Slowness IV | 42 | | |
|
||||
| Potion of Crashing | 43+ | | |
|
||||
| 药水名称 | 普通 | 延长版 | 强化版(II级) |
|
||||
| ------------------------ | ------- | ------- | ------------- |
|
||||
| 水瓶 | 0 | | |
|
||||
| 平凡药水 | 1 | 2 | |
|
||||
| 浓稠药水 | 3 | | |
|
||||
| 粗制药水 | 4 | | |
|
||||
| 夜视药水 | 5 | 6 | |
|
||||
| 隐身药水 | 7 | 8 | |
|
||||
| 跳跃药水 | 9 | 10 | 11 |
|
||||
| 抗火药水 | 12 | 13 | |
|
||||
| 迅捷药水 | 14 | 15 | 16 |
|
||||
| 迟缓药水 | 17 | 18 | |
|
||||
| 水肺药水 | 19 | 20 | |
|
||||
| 治疗药水 | 21 | | 22 |
|
||||
| 伤害药水 | 23 | | 24 |
|
||||
| 剧毒药水 | 25 | 26 | 27 |
|
||||
| 再生药水 | 28 | 29 | 30 |
|
||||
| 力量药水 | 31 | 32 | 33 |
|
||||
| 虚弱药水 | 34 | 35 | |
|
||||
| 衰变药水 | 36 | | |
|
||||
| 神龟药水 | 37 | 38 | 39 |
|
||||
| 缓降药水 | 40 | 41 | |
|
||||
| 迟缓IV药水 | 42 | | |
|
||||
| 跳跃提升IV药水 | 43+ | | |
|
||||
|
||||
### spawn_chance
|
||||
|
||||
Spawns an entity on hit.
|
||||
击中时生成实体。
|
||||
|
||||
| Name | Type | Description |
|
||||
| --------------------------- | ------- | ------------------------------------------- |
|
||||
| first_spawn_percent_chance | Decimal | |
|
||||
| second_spawn_percent_chance | Decimal | |
|
||||
| first_spawn_count | Integer | |
|
||||
| second_spawn_count | Integer | |
|
||||
| spawn_definition | String | ID of the entity to spawn |
|
||||
| spawn_baby | Boolean | Whether the spawned entity should be a baby |
|
||||
| 字段名称 | 类型 | 描述 |
|
||||
| ------------------------------- | -------- | ------------------------------- |
|
||||
| first_spawn_percent_chance | 小数 | |
|
||||
| second_spawn_percent_chance | 小数 | |
|
||||
| first_spawn_count | 整数 | |
|
||||
| second_spawn_count | 整数 | |
|
||||
| spawn_definition | 字符串 | 要生成的实体ID |
|
||||
| spawn_baby | 布尔值 | 生成的实体是否为幼体 |
|
||||
|
||||
### particle_on_hit
|
||||
|
||||
Spawns particles on hit.
|
||||
|
||||
| Name | Type | Description |
|
||||
| ------------- | ------- | -------------------------------------------------------- |
|
||||
| particle_type | String | [Vanilla Particles](/particles/vanilla-particles) to use |
|
||||
| num_particles | Integer | Number of particles |
|
||||
| on_entity_hit | Boolean | Whether it should spawn particles on entity hit |
|
||||
| on_other_hit | Boolean | Whether it should spawn particles on other hit |
|
||||
击中时生成粒子效果。
|
||||
|
||||
| 字段名称 | 类型 | 描述 |
|
||||
| ----------------- | -------- | ----------------------------------------------- |
|
||||
| particle_type | 字符串 | 使用的[原版粒子效果](/wiki/particles/vanilla-particles) |
|
||||
| num_particles | 整数 | 粒子数量 |
|
||||
| on_entity_hit | 布尔值 | 是否在击中实体时生成粒子 |
|
||||
| on_other_hit | 布尔值 | 是否在其他碰撞时生成粒子 |
|
||||
|
||||
### mob_effect
|
||||
|
||||
Applies a mob effect to the target.
|
||||
对目标施加生物状态效果。
|
||||
|
||||
| Name | Type | Description |
|
||||
| -------------- | ------- | ------------------------------------------- |
|
||||
| effect | String | Effect |
|
||||
| duration | Integer | Duration of the effect |
|
||||
| durationeasy | Integer | Duration of the effect on easy difficulty |
|
||||
| durationnormal | Integer | Duration of the effect on normal difficulty |
|
||||
| durationhard | Integer | Duration of the effect on hard difficulty |
|
||||
| amplifier | Integer | Effect amplifier |
|
||||
| ambient | Boolean | |
|
||||
| visible | Boolean | |
|
||||
| 字段名称 | 类型 | 描述 |
|
||||
| ------------------ | -------- | ------------------------------- |
|
||||
| effect | 字符串 | 效果类型 |
|
||||
| duration | 整数 | 效果持续时间 |
|
||||
| durationeasy | 整数 | 简单难度下的持续时间 |
|
||||
| durationnormal | 整数 | 普通难度下的持续时间 |
|
||||
| durationhard | 整数 | 困难难度下的持续时间 |
|
||||
| amplifier | 整数 | 效果等级 |
|
||||
| ambient | 布尔值 | |
|
||||
| visible | 布尔值 | |
|
||||
|
||||
### grant_xp
|
||||
|
||||
Despite the name, this actually spawns a number of experience orbs, being worth the amount stated.
|
||||
尽管名称如此,该行为实际上是生成指定数量的经验球。
|
||||
|
||||
| Name | Type | Description |
|
||||
| ----- | ------- | ----------------------------------------------------------------------------------------------- |
|
||||
| minXP | Integer | Minimum amount of experience to give |
|
||||
| maxXP | Integer | Maximum amount of experience to give |
|
||||
| xp | Integer | Constant amount of experience to give. When set, it will be used instead of min and max values. |
|
||||
| 字段名称 | 类型 | 描述 |
|
||||
| --------- | -------- | ------------------------------------------- |
|
||||
| minXP | 整数 | 给予的最小经验值 |
|
||||
| maxXP | 整数 | 给予的最大经验值 |
|
||||
| xp | 整数 | 固定经验值。设置后将覆盖min和max值 |
|
||||
|
||||
### freeze_on_hit
|
||||
|
||||
_Exact behavior unknown_
|
||||
_具体作用未知_
|
||||
|
||||
_Requires Education Edition toggle to be enabled._
|
||||
Freezes water on hit.
|
||||
_需要启用教育版功能_
|
||||
冻结命中点周围的水。
|
||||
|
||||
| Name | Type | Description |
|
||||
| ------------- | ------- | ----------------------------- |
|
||||
| shape | String | "sphere" or "cube" |
|
||||
| snap_to_block | Boolean | |
|
||||
| size | Integer | The size of the freeze effect |
|
||||
| 字段名称 | 类型 | 描述 |
|
||||
| ----------------- | -------- | --------------------- |
|
||||
| shape | 字符串 | "sphere" 或 "cube" |
|
||||
| snap_to_block | 布尔值 | |
|
||||
| size | 整数 | 冻结效果的范围大小 |
|
||||
|
||||
### hurt_owner
|
||||
|
||||
_Exact behavior unknown. Right now it crashes minecraft probably because of wrong parameters_
|
||||
_具体作用未知。当前版本可能导致游戏崩溃(可能参数错误)_
|
||||
|
||||
| Name | Type | Description |
|
||||
| ------------ | ------- | ----------- |
|
||||
| owner_damage | Integer | |
|
||||
| knockback | Boolean | |
|
||||
| ignite | Boolean | |
|
||||
| 字段名称 | 类型 | 描述 |
|
||||
| ---------------- | -------- | ---- |
|
||||
| owner_damage | 整数 | |
|
||||
| knockback | 布尔值 | |
|
||||
| ignite | 布尔值 | |
|
||||
|
||||
### thrown_potion_effect
|
||||
|
||||
_Exact behavior unknown. Right now it crashes minecraft probably because it's only valid for thrown potions_
|
||||
_具体作用未知。当前版本可能导致游戏崩溃(可能仅适用于投掷药水)_
|
||||
|
||||
## Additional Information
|
||||
When it comes to creating a custom projectile, such as an arrow or trident variant, or something entirely your own, you may want to consider defining a [runtime identifier](/entities/runtime-identifier) to ensure that it acts as intended. Not doing so may result in unintended behaviour, from odd visuals to incorrect knockback direction and arrows that you can kill with your bare hands.
|
||||
## 补充说明
|
||||
|
||||
在创建自定义投射物(如箭矢变体或全新物品)时,建议定义[运行时标识符](/wiki/entities/runtime-identifier)来确保预期行为。未正确设置可能导致异常表现,包括显示错误、击退方向异常,甚至出现可用徒手摧毁的箭矢等问题。
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: Molang Queries
|
||||
title: Molang 查询
|
||||
toc_max_level: 2
|
||||
mentions:
|
||||
- SirLich
|
||||
@@ -17,142 +17,142 @@ mentions:
|
||||
- ThomasOrs
|
||||
---
|
||||
|
||||
The bedrock documentation for Molang is notoriously bad. This page will attempt to remedy this by providing additional details for individual queries, _where possible_. This page is intended to be searched, not read in full. Use the side-bar, or use `ctrl-f` to navigate.
|
||||
# Molang 查询
|
||||
|
||||
<!--@include: @/wiki/bedrock-wiki-mirror.md-->
|
||||
|
||||
基岩版官方Molang文档存在诸多不足。本页面旨在通过为各个查询提供额外详细信息(在可能的情况下)改善这一现状。建议通过侧边栏导航或使用`Ctrl+F`进行搜索查阅,无需全文通读。
|
||||
|
||||
:::tip
|
||||
This page is not an exhaustive list list! It only contains queries we've written extra information for. The full list of queries can be found [here](https://bedrock.dev/docs/stable/Molang#List%20of%20Entity%20Queries)!
|
||||
本页面并非完整列表!仅包含我们补充了额外信息的查询。完整查询列表可访问[此处](https://bedrock.dev/docs/stable/Molang#List%20of%20Entity%20Queries)查看!
|
||||
:::
|
||||
|
||||
## query.armor_texture_slot
|
||||
|
||||
Formatted like: `query.armor_texture_slot(x) = y`.
|
||||
语法格式:`query.armor_texture_slot(x) = y`
|
||||
|
||||
Where `x` and `y` are both integer arguments, from the following table:
|
||||
其中`x`和`y`均为整型参数,对应以下表格:
|
||||
|
||||
### X
|
||||
### X 参数
|
||||
|
||||
| Argument | Slot |
|
||||
| -------- | ---------- |
|
||||
| 0 | Helmet |
|
||||
| 1 | Chestplace |
|
||||
| 2 | Leggings |
|
||||
| 3 | Boots |
|
||||
| 参数值 | 装备槽位 |
|
||||
| ------ | ---------- |
|
||||
| 0 | 头盔 |
|
||||
| 1 | 胸甲 |
|
||||
| 2 | 护腿 |
|
||||
| 3 | 靴子 |
|
||||
|
||||
### Y
|
||||
### Y 参数(常规)
|
||||
|
||||
| Argument | Type |
|
||||
| -------- | --------------------- |
|
||||
| -1 | none |
|
||||
| 0 | Leather armor piece |
|
||||
| 1 | Chain armor piece |
|
||||
| 2 | Iron armor piece |
|
||||
| 3 | Diamond armor piece |
|
||||
| 4 | Gold armor piece |
|
||||
| 5 | Elytra |
|
||||
| 6 | Turtle helmet |
|
||||
| 7 | Netherite armor piece |
|
||||
| 参数值 | 材质类型 |
|
||||
| ------ | ------------------ |
|
||||
| -1 | 无装备 |
|
||||
| 0 | 皮革护甲 |
|
||||
| 1 | 锁链护甲 |
|
||||
| 2 | 铁护甲 |
|
||||
| 3 | 钻石护甲 |
|
||||
| 4 | 金护甲 |
|
||||
| 5 | 鞘翅 |
|
||||
| 6 | 海龟壳头盔 |
|
||||
| 7 | 下界合金护甲 |
|
||||
|
||||
### Y for horses
|
||||
### Y 参数(马匹)
|
||||
|
||||
| Argument | Type |
|
||||
| -------- | --------------------- |
|
||||
| 1 | Leather armor piece |
|
||||
| 2 | Iron armor piece |
|
||||
| 3 | Gold armor piece |
|
||||
| 4 | Diamond armor piece |
|
||||
| 参数值 | 材质类型 |
|
||||
| ------ | ------------------ |
|
||||
| 1 | 皮革马铠 |
|
||||
| 2 | 铁马铠 |
|
||||
| 3 | 金马铠 |
|
||||
| 4 | 钻石马铠 |
|
||||
|
||||
### Example
|
||||
### 示例
|
||||
|
||||
`query.armor_texture_slot(3) == 1`: queries for Iron Boots.
|
||||
`query.armor_texture_slot(3) == 1`:检测是否穿着铁靴子
|
||||
|
||||
## query.armor_material_slot
|
||||
|
||||
Formatted like: `query.armor_material_slot(x) = y`.
|
||||
语法格式:`query.armor_material_slot(x) = y`
|
||||
|
||||
Where `x` and `y` are both integer arguments, from the following table:
|
||||
其中`x`和`y`均为整型参数,对应以下表格:
|
||||
|
||||
### X
|
||||
### X 参数
|
||||
|
||||
| Argument | Slot |
|
||||
| -------- | ---------- |
|
||||
| 0 | Helmet |
|
||||
| 1 | Chestplace |
|
||||
| 2 | Leggings |
|
||||
| 3 | Boots |
|
||||
| 参数值 | 装备槽位 |
|
||||
| ------ | ---------- |
|
||||
| 0 | 头盔 |
|
||||
| 1 | 胸甲 |
|
||||
| 2 | 护腿 |
|
||||
| 3 | 靴子 |
|
||||
|
||||
### Y
|
||||
### Y 参数(推测值)
|
||||
|
||||
Unknown, possibly:
|
||||
|
||||
| Argument | Slot |
|
||||
| -------- | -------------------------- |
|
||||
| 0 | Default armor material |
|
||||
| 1 | Enchanted armor material |
|
||||
| 2 | Leather armor material |
|
||||
| 3 | Leather enchanted material |
|
||||
| 参数值 | 材质类型 |
|
||||
| ------ | ---------------------- |
|
||||
| 0 | 默认护甲材质 |
|
||||
| 1 | 附魔护甲材质 |
|
||||
| 2 | 皮革护甲材质 |
|
||||
| 3 | 附魔皮革护甲材质 |
|
||||
|
||||
## query.armor_color_slot
|
||||
|
||||
_Notice: As of version `1.16.100.51`, this query is crashing minecraft. It might be fixed in later versions._
|
||||
*注意:截至版本`1.16.100.51`,此查询会导致游戏崩溃,可能在后续版本修复*
|
||||
|
||||
Formatted like: `color = query.armor_color_slot(slot, channel)`.
|
||||
语法格式:`color = query.armor_color_slot(slot, channel)`
|
||||
|
||||
Where `slot` and `channel` are both integer arguments, from the following tables:
|
||||
其中`slot`和`channel`均为整型参数,对应以下表格:
|
||||
|
||||
### Slot
|
||||
### Slot 参数
|
||||
|
||||
| Argument | Slot |
|
||||
| -------- | ---------- |
|
||||
| 0 | Helmet |
|
||||
| 1 | Chestplace |
|
||||
| 2 | Leggings |
|
||||
| 3 | Boots |
|
||||
| 参数值 | 装备槽位 |
|
||||
| ------ | ---------- |
|
||||
| 0 | 头盔 |
|
||||
| 1 | 胸甲 |
|
||||
| 2 | 护腿 |
|
||||
| 3 | 靴子 |
|
||||
|
||||
### Channel
|
||||
### Channel 参数
|
||||
|
||||
| Argument | Slot |
|
||||
| -------- | ------------- |
|
||||
| 0 | Red channel |
|
||||
| 1 | Green channel |
|
||||
| 2 | Blue channel |
|
||||
| 3 | Alpha channel |
|
||||
| 参数值 | 颜色通道 |
|
||||
| ------ | -------------- |
|
||||
| 0 | 红色通道 |
|
||||
| 1 | 绿色通道 |
|
||||
| 2 | 蓝色通道 |
|
||||
| 3 | 透明度通道 |
|
||||
|
||||
### Color
|
||||
### 返回值
|
||||
|
||||
Query returns color value in specified channel.
|
||||
返回指定通道的颜色值(0-1范围)
|
||||
|
||||
## query.get_equipped_item_name
|
||||
|
||||
:::warning
|
||||
**DEPRECATED QUERY:** It is recommended to use the new query (`query.is_item_name_any`) if possible as it is more of an updated version of this query. However, this query will still continue to work in the future for backwards compatibility.
|
||||
**已弃用查询**:建议优先使用新查询`query.is_item_name_any`,此查询未来仍会保留以兼容旧版本
|
||||
:::
|
||||
|
||||
Formatted like: `query.get_equipped_item_name('main_hand') = 'item_name'`
|
||||
语法格式:`query.get_equipped_item_name('main_hand') = 'item_name'`
|
||||
|
||||
Takes one optional hand slot as a parameter (0 or 'main_hand' for main hand, 1 or 'off_hand' for off hand), and a second parameter (0=default) if you would like the equipped item or any non-zero number for the currently rendered item, and returns the name of the item in the requested slot (defaulting to the main hand if no parameter is supplied) if there is one, otherwise returns ''.
|
||||
接受一个可选的手部槽位参数(0或'main_hand'表示主手,1或'off_hand'表示副手),第二个参数(0=默认)用于选择装备物品或当前渲染物品,返回对应槽位的物品名称(无参数时默认主手),无物品时返回空字符串。
|
||||
|
||||
Where `item_name` is the item you want to test for. No namespace, and please notice the quotes.
|
||||
`item_name`需使用不带命名空间的物品ID,注意保留引号
|
||||
|
||||
Example: `"query.get_equipped_item_name == 'diamond'"`
|
||||
示例:`"query.get_equipped_item_name == 'diamond'"`
|
||||
|
||||
**Can you test for items in the inventory? Yes! Using the new query `query.is_item_name_any`.**
|
||||
**如何检测背包物品?可以使用新查询`query.is_item_name_any`!**
|
||||
|
||||
## query.get_name
|
||||
|
||||
:::warning
|
||||
**DEPRECATED QUERY:** It is recommended to use the new query (`query.is_name_any`) if possible as it is more of an updated version of this query. However, this query will still continue to work in the future for backwards compatibility.
|
||||
**已弃用查询**:建议优先使用新查询`query.is_name_any`,此查询未来仍会保留以兼容旧版本
|
||||
:::
|
||||
|
||||
Formatted like: `query.get_name == 'Name'`
|
||||
语法格式:`query.get_name == '名称'`
|
||||
|
||||
Turns true if actual in-game displayed name matches name (use OnixClient to see names in third view).
|
||||
Needs to be used in special conditions.
|
||||
当实体显示名称匹配时返回true(需使用OnixClient等工具查看第三方视角名称),需在特定条件下使用
|
||||
|
||||
<Spoiler title="Show">
|
||||
<Spoiler title="展开示例">
|
||||
|
||||
<CodeHeader>animation_controllers/ac.json</CodeHeader>
|
||||
|
||||
```json
|
||||
::: code-group
|
||||
```json [animation_controllers/ac.json]
|
||||
{
|
||||
"format_version": "1.10.0",
|
||||
"animation_controllers": {
|
||||
@@ -174,7 +174,7 @@ Needs to be used in special conditions.
|
||||
],
|
||||
"animations": [
|
||||
{
|
||||
"anim": "query.get_name == '...'" // You can use it only here!
|
||||
"anim": "query.get_name == '...'" // 只能在此处使用!
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -183,21 +183,20 @@ Needs to be used in special conditions.
|
||||
}
|
||||
}
|
||||
```
|
||||
:::
|
||||
|
||||
</Spoiler>
|
||||
|
||||
## query.is_name_any
|
||||
|
||||
Formatted like: `query.get_name('Name1', 'Name2')`.
|
||||
Takes one or more arguments.
|
||||
Turns true if actual in-game displayed name matches one of the given names.
|
||||
Needs to be used in special conditions.
|
||||
语法格式:`query.is_name_any('名称1', '名称2')`
|
||||
|
||||
<Spoiler title="Show">
|
||||
接受一个或多个参数,当实体显示名称匹配任一参数时返回true,需在特定条件下使用
|
||||
|
||||
<CodeHeader>animation_controllers/ac.json</CodeHeader>
|
||||
<Spoiler title="展开示例">
|
||||
|
||||
```json
|
||||
::: code-group
|
||||
```json [animation_controllers/ac.json]
|
||||
{
|
||||
"format_version": "1.10.0",
|
||||
"animation_controllers": {
|
||||
@@ -219,7 +218,7 @@ Needs to be used in special conditions.
|
||||
],
|
||||
"animations": [
|
||||
{
|
||||
"anim": "query.is_name_any(...)" // You can use it only here!
|
||||
"anim": "query.is_name_any(...)" // 只能在此处使用!
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -228,340 +227,249 @@ Needs to be used in special conditions.
|
||||
}
|
||||
}
|
||||
```
|
||||
:::
|
||||
|
||||
</Spoiler>
|
||||
|
||||
## query.is_item_name_any
|
||||
|
||||
Formatted like: `query.is_item_name_any('slot.weapon.mainhand', 0, 'namespace:item_name')`
|
||||
语法格式:`query.is_item_name_any('slot.weapon.mainhand', 0, '命名空间:物品名称')`
|
||||
|
||||
Takes the equipment slot name first, followed by the slot index value, and then the list of item names with namespaces after it.
|
||||
参数顺序:装备槽名称 → 槽位索引 → 带命名空间的物品名称列表
|
||||
|
||||
Possible equipment slot are as follows:
|
||||
| Slot Name | Slot Counts | Description |
|
||||
| ---------------------- | ----------- | ----------------------------------------------------------------------------------- |
|
||||
| `slot.weapon.mainhand` | 0 | Usually any held items are in here |
|
||||
| `slot.weapon.offhand` | 0 | Offhand slot for things like `Shield`, `Totem of Undying` or a `Map` |
|
||||
| `slot.armor.head` | 0 | Head armor piece |
|
||||
| `slot.armor.chest` | 0 | Chestplate armor piece |
|
||||
| `slot.armor.legs` | 0 | Leggings armor piece |
|
||||
| `slot.armor.feet` | 0 | Boots armor piece |
|
||||
| `slot.armor` | 0 | Horse armor |
|
||||
| `slot.saddle` | 0 | Saddle slot |
|
||||
| `slot.hotbar` | 0 to 8 | Player hotbar slots |
|
||||
| `slot.inventory` | 0+ (varies) | Entities that has an inventory, like the player, minecart with chests, donkey, etc. |
|
||||
| `slot.enderchest` | 0 to 26 | Ender chest inventory for players only |
|
||||
可用槽位列表:
|
||||
| 槽位名称 | 槽位数 | 说明 |
|
||||
| -------------------- | ------ | ----------------------------- |
|
||||
| `slot.weapon.mainhand` | 0 | 主手持握物品 |
|
||||
| `slot.weapon.offhand` | 0 | 副手(盾牌、地图等) |
|
||||
| `slot.armor.head` | 0 | 头部护甲 |
|
||||
| `slot.armor.chest` | 0 | 胸甲 |
|
||||
| `slot.armor.legs` | 0 | 护腿 |
|
||||
| `slot.armor.feet` | 0 | 靴子 |
|
||||
| `slot.armor` | 0 | 马铠 |
|
||||
| `slot.saddle` | 0 | 鞍具 |
|
||||
| `slot.hotbar` | 0-8 | 玩家快捷栏 |
|
||||
| `slot.inventory` | 可变 | 实体库存(箱子矿车、驴等) |
|
||||
| `slot.enderchest` | 0-26 | 末影箱(仅玩家) |
|
||||
|
||||
### Test for items within the player's inventory
|
||||
### 检测玩家背包物品
|
||||
|
||||
Formatted like: `t.val = 0; t.i = 0; loop(27, {t.val = q.is_item_name_any('slot.inventory', t.i, 'namespace:item_name'); t.val ? {return t.val;}; t.i = t.i+1;});`
|
||||
|
||||
Replace `namespace:item_name` with any item you wish to check for. This simply loops through all 27 slots of the inventory and returns `1.0` if it has found any slot that has the specified item provided. Note that the hotbar is in a different slot from the main inventory slot so you will have to check that separately.
|
||||
示例代码:
|
||||
```molang
|
||||
t.val = 0;
|
||||
t.i = 0;
|
||||
loop(27, {
|
||||
t.val = q.is_item_name_any('slot.inventory', t.i, '命名空间:物品名称');
|
||||
t.val ? {return t.val;};
|
||||
t.i = t.i+1;
|
||||
});
|
||||
```
|
||||
替换`命名空间:物品名称`为目标物品,此代码会遍历27个背包槽位,检测到目标物品时返回1.0。注意快捷栏与主背包槽位独立,需分开检测。
|
||||
|
||||
## query.is_enchanted
|
||||
|
||||
Formatted like: `is_enchanted = query.is_enchanted`.
|
||||
语法格式:`is_enchanted = query.is_enchanted`
|
||||
|
||||
Return 1.0 or 0.0 based on whether the entity is enchanted.
|
||||
返回1.0(已附魔)或0.0(未附魔)
|
||||
|
||||
_Currently, can be only used in materials._
|
||||
*目前仅能在材质中使用*
|
||||
|
||||
## query.is_eating
|
||||
|
||||
This query tracks when certain entities are 'eating'. It's not used for the player. To trigger, use one of the following components:
|
||||
- `minecraft:behavior.eat_carried_item`
|
||||
- `minecraft:behavior.snacking`
|
||||
检测实体是否处于"进食"状态(不适用于玩家)。需配合以下组件使用:
|
||||
- `minecraft:behavior.eat_carried_item`
|
||||
- `minecraft:behavior.snacking`
|
||||
|
||||
## query.is_ghost
|
||||
|
||||
Formatted like: `is_ghost = query.is_ghost`.
|
||||
语法格式:`is_ghost = query.is_ghost`
|
||||
|
||||
Return 1.0 or 0.0 based on whether the entity is a ghost.
|
||||
返回1.0(幽灵实体)或0.0
|
||||
|
||||
_Currently, only returns 1.0 for a guardian ghost and is used by its renderer._
|
||||
*当前仅对守护者幽灵有效,用于渲染控制*
|
||||
|
||||
## query.is_grazing
|
||||
|
||||
Formatted like: `is_grazing = query.is_grazing`.
|
||||
语法格式:`is_grazing = query.is_grazing`
|
||||
|
||||
Return 1.0 or 0.0 based on whether the entity is eating a block.
|
||||
检测实体是否在啃食方块(如绵羊吃草)
|
||||
|
||||
_Currently, only returns 1.0 for a sheep and entities using runtime identifier of a sheep._
|
||||
*目前仅对绵羊及使用绵羊运行ID的实体有效*
|
||||
|
||||
## query.is_jumping
|
||||
|
||||
Formatted like: `is_jumping = query.is_jumping`.
|
||||
语法格式:`is_jumping = query.is_jumping`
|
||||
|
||||
Return 1.0 or 0.0 based on whether the entity is jumping.
|
||||
返回1.0(跳跃中)或0.0
|
||||
|
||||
For the player, conditions for its activation are:
|
||||
|
||||
- the jump button is pressed (includes being in water and climbing a scaffolding)
|
||||
- OR auto-jump is triggered
|
||||
- OR swimming with auto-jump
|
||||
- OR charging the jump of a ridable entity
|
||||
玩家触发条件:
|
||||
- 按下跳跃键(包含水中跳跃、攀爬脚手架)
|
||||
- 自动跳跃触发
|
||||
- 游泳时自动跳跃
|
||||
- 骑乘实体蓄力跳跃
|
||||
|
||||
## query.modified_move_speed
|
||||
|
||||
Formatted like: `modified_move_speed = query.modified_move_speed`.
|
||||
语法格式:`modified_move_speed = query.modified_move_speed`
|
||||
|
||||
Returns the current walk speed of the entity modified by status flags such as is_baby or on_fire
|
||||
返回实体当前移动速度(受幼体、着火等状态影响)
|
||||
|
||||
Value example:
|
||||
|
||||
- Player is walking: around 0.86
|
||||
- Player is sprinting: 1.0
|
||||
- Player is sprinting and jumping: 0.35
|
||||
- Player is walking on fire: 1.0
|
||||
- Player is sprinting on fire: 1.0
|
||||
- Player is sprinting and jumping on fire: 0.525
|
||||
参考值:
|
||||
- 行走:约0.86
|
||||
- 疾跑:1.0
|
||||
- 疾跑跳跃:0.35
|
||||
- 着火行走:1.0
|
||||
- 着火疾跑:1.0
|
||||
- 着火疾跑跳跃:0.525
|
||||
|
||||
## query.log
|
||||
|
||||
Content log is NOT debug log, they're different files. `query.log` outputs to the debug log only.
|
||||
将日志输出到调试日志(注意:content log与debug log不同)
|
||||
|
||||
## query.on_fire_time
|
||||
|
||||
Formatted like: `on_fire_time = query.on_fire_time`.
|
||||
语法格式:`on_fire_time = query.on_fire_time`
|
||||
|
||||
Returns the time in ticks since the entity started or stopped being on fire, else it returns 0.0
|
||||
返回实体着火/灭火后的持续时间(刻),未着火时返回0.0
|
||||
|
||||
Value example:
|
||||
|
||||
- Entity is summoned: value is 0
|
||||
- Entity is ignited: value is 0 and starts counting up 1 every tick
|
||||
- Entity is on fire for 2 seconds already: value is 40 and still counts up 1 every tick
|
||||
- Entity stops being on fire: value resets to 0 and continues to count up 1 every tick despite not being on fire
|
||||
- Entity is ignited second time: value resets to 0 and continues counting up 1 every tick
|
||||
- Entity stops being on fire the second time: value resets to 0 and continues to count up 1 every tick despite not being on fire
|
||||
|
||||
Basically it's tick timer that starts after entity is first ignited and resets every time it changes from/to being on fire.
|
||||
计时规则:
|
||||
- 实体生成:0
|
||||
- 点燃:开始递增(1刻/次)
|
||||
- 灭火:重置0并继续递增
|
||||
- 重复点燃/灭火:每次状态变化重置计时
|
||||
|
||||
## query.scoreboard
|
||||
|
||||
Formatted like: `query.scoreboard('objective_name') > 0`
|
||||
语法格式:`query.scoreboard('计分项名称') > 数值`
|
||||
|
||||
Returns 1.0 or 0.0 if the queried value is within the specified range provided. Or based on score count, molang operator and number.
|
||||
根据计分板值返回1.0或0.0
|
||||
|
||||
Note that sometimes it might not work because of unknown reasons. One of which is that this cannot query scoreboard objective names with uppercase letters. In this case, for example, objective `testfoo` will work but **not** `testFoo`.
|
||||
注意:
|
||||
- 无法检测含大写字母的计分项(如`testFoo`无效,需使用`testfoo`)
|
||||
- 部分情况可能异常
|
||||
|
||||
## query.structural_integrity
|
||||
|
||||
Formatted like: `structural_integrity = query.structural_integrity`.
|
||||
语法格式:`structural_integrity = query.structural_integrity`
|
||||
|
||||
Used by boats and minecarts for destroying it. It will decrease when attacking the entity and will recover with time.
|
||||
Probably unusable by anything other than boats and minecarts.
|
||||
用于船和矿车的耐久系统(受攻击减少,随时间恢复)
|
||||
|
||||
*可能无法用于其他实体*
|
||||
|
||||
## variable.attack_time
|
||||
|
||||
### Explanation
|
||||
### 说明
|
||||
|
||||
This variable is setup as IF it was a query. In other words, it can be used on any entity, both on the client and server, regardless of whether you setup/define the variable correctly.
|
||||
该变量作为查询使用,可在任意实体(客户端/服务端)生效,无需预先定义
|
||||
|
||||
### For entities
|
||||
### 实体行为
|
||||
|
||||
The variable tracks when the entity is swinging to attack. When not attacking, it will return 0.0, when attacking it will range from 0.0 to the total attack time, which may be around 0.3 or something similar. For players, this value ranges from 0.0 to 1.0. The variable returns a percentage, in the form of a decimal, for how far into the attack the entity is. For example, if an entity is halfway into its attack swing, then the variable will return 0.5. It increments linearly.
|
||||
追踪实体攻击动作进度:
|
||||
- 未攻击:0.0
|
||||
- 攻击中:0.0~总攻击时间(约0.3)
|
||||
- 玩家:0.0~1.0(线性增长)
|
||||
|
||||
### For the Player
|
||||
### 玩家行为
|
||||
|
||||
For the player, the variable will track whenever the arm bones are swinging, this includes:
|
||||
|
||||
- placing blocks
|
||||
- placing entities
|
||||
- interacting (when swing is enabled)
|
||||
- melee attack
|
||||
追踪手臂摆动动作(包含以下情况):
|
||||
- 放置方块
|
||||
- 放置实体
|
||||
- 交互动作(当启用摆动时)
|
||||
- 近战攻击
|
||||
|
||||
## query.is_roaring
|
||||
|
||||
Evaluates to true when a `knockback_roar` attack is happening.
|
||||
当实体执行`knockback_roar`攻击时返回true
|
||||
|
||||
## query.head_x_rotation
|
||||
|
||||
Formatted like: `query.head_x_rotation(x)`
|
||||
语法格式:`query.head_x_rotation(x)`
|
||||
|
||||
Where `x` specifies the head of the entity. It is not really relevant for any entity but the wither.
|
||||
`x`参数指定头部编号(主要用于凋灵)
|
||||
|
||||
Returns head pitch. looking up returns `-89.9`, looking all the way down returns `89.9`.
|
||||
返回值:
|
||||
- 仰角(向上-89.9,向下89.9)
|
||||
|
||||
## query.head_y_rotation
|
||||
|
||||
Formatted like: `query.head_y_rotation(x)`
|
||||
语法格式:`query.head_y_rotation(x)`
|
||||
|
||||
Where `x` specifies the head of the entity. It is not really relevant for any entity but the wither.
|
||||
`x`参数指定头部编号(主要用于凋灵)
|
||||
|
||||
Returns yaw of the head from `-179.9` to `179.9`. the values wrap around so like if you are at `-179.9` and you turn just a little bit, it instantly goes to `179.9`.
|
||||
返回值:
|
||||
- 偏航角(-179.9~179.9,循环变化)
|
||||
|
||||
## query.target_x_rotation and query.target_y_rotation
|
||||
## query.target_x_rotation 与 query.target_y_rotation
|
||||
|
||||
Identical to the respective `query.head_*_rotation`, however has no optional argument for selecting head.
|
||||
功能同`query.head_*_rotation`,但无需指定头部参数
|
||||
|
||||
## query.time_of_day
|
||||
|
||||
Returns the time of day (midnight=0.0, sunrise=0.25, noon=0.5, sunset=0.75) of the dimension the entity is in.
|
||||
Day time is calculated via this formula:
|
||||
返回维度时间(午夜=0.0,日出=0.25,正午=0.5,日落=0.75)
|
||||
|
||||
`f(x) = (x*0.25/2400)mod 1`
|
||||
计算公式:`(当前刻数*0.25/2400) mod 1`
|
||||
|
||||
query.time_of_day - day time table
|
||||
时间对应表:
|
||||
|
||||
<Spoiler title="Show">
|
||||
<Spoiler title="展开时间表">
|
||||
|
||||
| `query.time_of_day` | Day Time |
|
||||
| ------------------- | -------- |
|
||||
| 0.00 | 18000 |
|
||||
| 0.01 | 18240 |
|
||||
| 0.02 | 18480 |
|
||||
| 0.03 | 18720 |
|
||||
| 0.04 | 18960 |
|
||||
| 0.05 | 19200 |
|
||||
| 0.06 | 19440 |
|
||||
| 0.07 | 19680 |
|
||||
| 0.08 | 19920 |
|
||||
| 0.09 | 20162 |
|
||||
| 0.10 | 20400 |
|
||||
| 0.11 | 20640 |
|
||||
| 0.12 | 20880 |
|
||||
| 0.13 | 21120 |
|
||||
| 0.14 | 21360 |
|
||||
| 0.15 | 21602 |
|
||||
| 0.16 | 21840 |
|
||||
| 0.17 | 22080 |
|
||||
| 0.18 | 22322 |
|
||||
| 0.19 | 22560 |
|
||||
| 0.20 | 22800 |
|
||||
| 0.21 | 23040 |
|
||||
| 0.22 | 23280 |
|
||||
| 0.23 | 23520 |
|
||||
| 0.24 | 23760 |
|
||||
| 0.25 | 0 |
|
||||
| 0.26 | 240 |
|
||||
| 0.27 | 480 |
|
||||
| 0.28 | 720 |
|
||||
| 0.29 | 960 |
|
||||
| 0.30 | 1202 |
|
||||
| 0.31 | 1440 |
|
||||
| 0.32 | 1680 |
|
||||
| 0.33 | 1922 |
|
||||
| 0.34 | 2160 |
|
||||
| 0.35 | 2400 |
|
||||
| 0.36 | 2642 |
|
||||
| 0.37 | 2880 |
|
||||
| 0.38 | 3120 |
|
||||
| 0.39 | 3360 |
|
||||
| 0.40 | 3600 |
|
||||
| 0.41 | 3840 |
|
||||
| 0.42 | 4080 |
|
||||
| 0.43 | 4320 |
|
||||
| 0.44 | 4560 |
|
||||
| 0.45 | 4800 |
|
||||
| 0.46 | 5040 |
|
||||
| 0.47 | 5280 |
|
||||
| 0.48 | 5520 |
|
||||
| 0.49 | 5760 |
|
||||
| 0.50 | 6000 |
|
||||
| 0.51 | 6240 |
|
||||
| 0.52 | 6480 |
|
||||
| 0.53 | 6720 |
|
||||
| 0.54 | 6960 |
|
||||
| 0.55 | 7200 |
|
||||
| 0.56 | 7440 |
|
||||
| 0.57 | 7680 |
|
||||
| 0.58 | 7920 |
|
||||
| 0.59 | 8160 |
|
||||
| 0.60 | 8402 |
|
||||
| 0.61 | 8640 |
|
||||
| 0.62 | 8880 |
|
||||
| 0.63 | 9120 |
|
||||
| 0.64 | 9360 |
|
||||
| 0.65 | 9600 |
|
||||
| 0.66 | 9842 |
|
||||
| 0.67 | 10080 |
|
||||
| 0.68 | 10320 |
|
||||
| 0.69 | 10560 |
|
||||
| 0.70 | 10800 |
|
||||
| 0.71 | 11040 |
|
||||
| 0.72 | 11282 |
|
||||
| 0.73 | 11520 |
|
||||
| 0.74 | 11760 |
|
||||
| 0.75 | 12000 |
|
||||
| 0.76 | 12240 |
|
||||
| 0.77 | 12480 |
|
||||
| 0.78 | 12720 |
|
||||
| 0.79 | 12962 |
|
||||
| 0.80 | 13200 |
|
||||
| 0.81 | 13440 |
|
||||
| 0.82 | 13680 |
|
||||
| 0.83 | 13920 |
|
||||
| 0.84 | 14160 |
|
||||
| 0.85 | 14402 |
|
||||
| 0.86 | 14640 |
|
||||
| 0.87 | 14880 |
|
||||
| 0.88 | 15120 |
|
||||
| 0.89 | 15360 |
|
||||
| 0.90 | 15600 |
|
||||
| 0.91 | 15842 |
|
||||
| 0.92 | 16080 |
|
||||
| 0.93 | 16320 |
|
||||
| 0.94 | 16560 |
|
||||
| 0.95 | 16800 |
|
||||
| 0.96 | 17040 |
|
||||
| 0.97 | 17282 |
|
||||
| 0.98 | 17520 |
|
||||
| 0.99 | 17760 |
|
||||
| 1.00 | 18000 |
|
||||
| query.time_of_day | 游戏刻数 |
|
||||
| ----------------- | -------- |
|
||||
| 0.00 | 18000 |
|
||||
| 0.25 | 0 |
|
||||
| 0.50 | 6000 |
|
||||
| 0.75 | 12000 |
|
||||
| ... | ... |
|
||||
|
||||
Credit: [Analysis of query.time_of_day](https://gist.github.com/DoubleF3lix/a03afde0a979dfa41e8525ee92f12ca5)
|
||||
*完整表格详见原文档*
|
||||
|
||||
</Spoiler>
|
||||
|
||||
## query.eye_target_x_rotation and query.eye_target_y_rotation
|
||||
## query.eye_target_x_rotation 与 query.eye_target_y_rotation
|
||||
|
||||
Not valid for player. not really sure what its good for.
|
||||
不适用于玩家,具体用途待验证
|
||||
|
||||
## variable.short_arm_offset_right
|
||||
|
||||
Returns the offset factor for the player's rightarm bone compared to the default skin geometry. Slim-armed (3 pixel wide) skins will return `0.5` when equipped on the player. Normal (4 pixel wide) skins will return `0.0` when equipped on the player. Note: the player must go into 1st person perspective at least once for this variable to be initialized and usable elsewhere on the entity.
|
||||
返回玩家右臂骨骼偏移因子:
|
||||
- 细臂皮肤(3像素宽):0.5
|
||||
- 常规皮肤(4像素宽):0.0
|
||||
|
||||
*注意:需进入第一人称视角初始化变量*
|
||||
|
||||
## variable.short_arm_offset_left
|
||||
|
||||
Identical behavior to `variable.short_arm_offset_right` except it references the player leftarm bone.
|
||||
功能同`variable.short_arm_offset_right`,对应左臂骨骼
|
||||
|
||||
## query.movement_direction
|
||||
|
||||
Returns one of the 3 components from the normalized vector of the entity movement meaning the magnitude/modulus/length of the vector is between 0 and 1.
|
||||
返回实体移动方向向量的归一化分量(模长0~1)
|
||||
|
||||
**Note**: As of writing the documentation, the value returned from any of the axis will change depending on the speed of the entity (If the entity is on the ground the value will be less than the value of the entity if it were in the air even if it is moving in the same direction).
|
||||
注意:实际值受移动速度影响(地面移动值小于空中相同方向)
|
||||
|
||||
To get the actual normalized velocity vector of the entity movement you will have to normalize the values. Here is the Molang setup:
|
||||
|
||||
```
|
||||
variable.mag = math.sqrt( math.pow( query.movement_direction(0), 2 ) + math.pow( query.movement_direction(1), 2) + math.pow( query.movement_direction(2), 2));
|
||||
variable.xNorm = query.movement_direction(0) / variable.mag;
|
||||
variable.yNorm = query.movement_direction(1) / variable.mag;
|
||||
variable.zNorm = query.movement_direction(2) / variable.mag;
|
||||
归一化处理示例:
|
||||
```molang
|
||||
variable.mag = math.sqrt(math.pow(query.movement_direction(0),2) + ...);
|
||||
variable.xNorm = query.movement_direction(0)/variable.mag;
|
||||
// y/z同理
|
||||
```
|
||||
|
||||
For more information on normalized vectors you can play around with this <a href=https://www.desmos.com/calculator/hhoamwgve2>Desmos graph</a>
|
||||
| 参数 | 轴向 |
|
||||
| ---- | ---- |
|
||||
| 0 | X轴 |
|
||||
| 1 | Y轴 |
|
||||
| 2 | Z轴 |
|
||||
|
||||
| Argument | Axis |
|
||||
| -------- | ---- |
|
||||
| 0 | X |
|
||||
| 1 | Y |
|
||||
| 2 | Z |
|
||||
## query.block_neighbor_has_any_tag 与 query.relative_block_has_any_tag
|
||||
|
||||
## query.block_neighbor_has_any_tag and query.relative_block_has_any_tag
|
||||
*需启用`Experimental Molang Features`*
|
||||
|
||||
Requires `Experimental Molang Features` to use. From the docs `Takes a relative position and one or more tag names, and returns either 0 or 1 based on if the block at that position has any of the tags provided`. This is useful for using connecting blocks or detecting entities.
|
||||
语法:
|
||||
- `q.block_neighbor_has_any_tag(x,y,z,'标签')`
|
||||
- `q.relative_block_has_any_tag(x,y,z,'标签')`
|
||||
|
||||
`query.block_neighbor_has_any_tag` - Takes block position
|
||||
`query.relative_block_has_any_tag` - Takes entity position
|
||||
示例:
|
||||
- `q.relative_block_has_any_tag(0,-1,0,'grass')`:检测实体下方草方块
|
||||
- 支持多标签检测:`q.query(0,-1,0,'grass','plant')`
|
||||
|
||||
The syntax for it is `q.block_neighbor_has_any_tag(x,y,z,'tag_name')` and `q.relative_block_has_any_tag(x,y,z,'tag_name')`.
|
||||
|
||||
Example:
|
||||
- `q.relative_block_has_any_tag(0,-1,0,'grass')` would try to detect a block with the grass tag one block under the entity.
|
||||
- `q.block_neighbor_has_any_tag(0,-1,0,'grass')` would try to detect a block with the grass tag one block under the block.
|
||||
|
||||
To do multiple tags you would use `q.correct_query(0,-1,0,'grass', 'plant')` with `correct_query` being replaced by the right query.
|
||||
|
||||
Note that this can also detect custom tags and [vanilla tags](/blocks/block-tags)
|
||||
可检测原版与[自定义方块标签](/wiki/blocks/block-tags)
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: Shared Constructs
|
||||
title: 共享结构体
|
||||
nav_order: 1
|
||||
tags:
|
||||
- Stable
|
||||
@@ -9,32 +9,34 @@ mentions:
|
||||
- ThomasOrs
|
||||
---
|
||||
|
||||
A few JSON constructs are expressible in multiple locations in the add-ons system.
|
||||
# 共享结构体
|
||||
|
||||
## Range Objects
|
||||
Range objects define a spread between two numbers.
|
||||
<!--@include: @/wiki/bedrock-wiki-mirror.md-->
|
||||
|
||||
<CodeHeader>Range Object Example</CodeHeader>
|
||||
在附加包系统中,部分JSON结构体可以在多个模块中通用。
|
||||
|
||||
```json
|
||||
## 范围对象
|
||||
范围对象用于定义两个数值之间的区间。
|
||||
|
||||
::: code-group
|
||||
```json [范围对象示例]
|
||||
{
|
||||
"min": 2,
|
||||
"max": 4
|
||||
}
|
||||
```
|
||||
|
||||
When provided, a random value will be selected inclusively between the minimum and maximum. Rolls are not retained; a new random value will be rolled each instance the range object would be used. The maximum must not be less than the minimum, but they may be equal to affix rolls to a specific value.
|
||||
当使用该对象时,系统会在最小值(含)和最大值(含)之间随机选取一个数值。每次调用范围对象都会重新进行随机取值。最大值不可小于最小值,但允许两者相等以实现固定取值。
|
||||
|
||||
## Fraction Objects
|
||||
Fraction objects define a fraction using a numerator and denominator.
|
||||
## 分数对象
|
||||
分数对象通过分子和分母定义分数关系。
|
||||
|
||||
<CodeHeader>Fraction Object Example</CodeHeader>
|
||||
|
||||
```json
|
||||
::: code-group
|
||||
```json [分数对象示例]
|
||||
{
|
||||
"numerator": 3,
|
||||
"denominator": 5
|
||||
}
|
||||
```
|
||||
|
||||
The value used in place of the object will be the computed division, `numerator` ÷ `denominator`. Both the numerator and denominator must be at least `1`, and the denominator cannot be equal to the numerator.
|
||||
该对象在计算时将使用分子除以分母的商值(即 `分子` ÷ `分母`)。分子和分母的数值必须大于等于 `1`,且分母不能等于分子(即不能形成值为1的分数)。
|
||||
Reference in New Issue
Block a user