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

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

View File

@@ -0,0 +1,40 @@
---
title: Shared Constructs
nav_order: 1
tags:
- Stable
- Last updated for Version 1.18.10
mentions:
- Ciosciaa
- 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.
<CodeHeader>Range Object Example</CodeHeader>
```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
{
"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.