完整版BedrockWiki镜像!
This commit is contained in:
@@ -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