-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
211 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
33 changes: 33 additions & 0 deletions
33
docs/zh/modpack/kubejs/1.20.1/Introduction/LootTable/BasicKnowledge/LootEntry.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# 抽取项 | ||
|
||
- 抽取项存在于每个随机池的抽取项列表中。 | ||
|
||
## 抽取项类型 | ||
|
||
| 抽取项类型 | 作用 | 语句 | | ||
|:------------:|:---------:|:---------:| | ||
| 选择 | 从中掉落第一个满足条件的战利品 | - | | ||
| 动态 | 用于潜影盒与纹饰陶罐 | - | | ||
| 空 | 什么都不掉的战利品 | addEmpty() | | ||
| 物品 | 掉落一个物品 | addItem() | | ||
| 组 | 掉落一组物品 | - | | ||
| 战利品表 | 从另一个战利品表决定掉落什么 | - | | ||
| 序列 | 按依次掉落,直到某一项谓词不通过 | - | | ||
| 物品标签 | 掉落标签中1个或全部物品 | - | | ||
|
||
## 添加抽取项 | ||
|
||
- 在addPool(pool=>{})中使用; | ||
|
||
- 示例: | ||
|
||
```js | ||
ServerEvents.blockLootTables(event => { | ||
event.addBlock('minecraft:gravel', loot => { | ||
loot.addPool(pool => { | ||
pool.addItem('minecraft:diamond')// [!code ++] | ||
}) | ||
}) | ||
}) | ||
|
||
``` |
62 changes: 62 additions & 0 deletions
62
docs/zh/modpack/kubejs/1.20.1/Introduction/LootTable/BasicKnowledge/LootPool.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# 随机池 | ||
|
||
- 存在于每个战利品表的随机池列表中,内含抽取项(战利品),每个随机池都有自己的抽取次数设置,触发战利品表时每个随机池进行有放回的独立抽取。 | ||
|
||
## 添加随机池 | ||
|
||
- 创建一个新随机池。 | ||
|
||
- 语句:addPool(pool=>{}); | ||
|
||
```js | ||
ServerEvents.blockLootTables(event => { | ||
event.addBlock('minecraft:gravel', loot => { | ||
loot.addPool(pool => {// [!code ++] | ||
})// [!code ++] | ||
}) | ||
}) | ||
``` | ||
|
||
## 抽取次数 | ||
|
||
- **`默认值`** 默认值为1。 | ||
|
||
- pool.rolls 是一个[数字提供器](../MiscellaneousKnowledge/NumberProvider.md) | ||
|
||
- pool.setUniformRolls(min, max) 设置取值范围,接受最小值与最大值 | ||
|
||
- pool.setBinomialRolls(n, p) 设置二项分布,接受n尝试次数,p每次尝试成功概率,期望次数np | ||
|
||
::: code-group | ||
|
||
```js [绝对值] | ||
ServerEvents.blockLootTables(event => { | ||
event.addBlock('minecraft:gravel', loot => { | ||
loot.addPool(pool => { | ||
pool.rolls = 1// [!code ++] | ||
}) | ||
}) | ||
}) | ||
``` | ||
|
||
```js [取值范围] | ||
ServerEvents.blockLootTables(event => { | ||
event.addBlock('minecraft:gravel', loot => { | ||
loot.addPool(pool => { | ||
pool.setUniformRolls(1, 1)// [!code ++] | ||
}) | ||
}) | ||
}) | ||
``` | ||
|
||
```js [二项分布] | ||
ServerEvents.blockLootTables(event => { | ||
event.addBlock('minecraft:gravel', loot => { | ||
loot.addPool(pool => { | ||
pool.setBinomialRolls(5, 0.5)// [!code ++] | ||
}) | ||
}) | ||
}) | ||
``` | ||
|
||
::: |
16 changes: 16 additions & 0 deletions
16
docs/zh/modpack/kubejs/1.20.1/Introduction/LootTable/BasicKnowledge/LootType.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# 战利品表类型 | ||
|
||
- **`战利品表类型`** 战利品表上下文类型,也称为战利品表类型。 | ||
|
||
- 类型决定不同战利品表的作用。 | ||
|
||
- 类型决定不同战利品表的可用的谓词与修饰器。 | ||
|
||
| 战利品表类型 | 事件 | 示例 | | ||
|:------------:|:---------:|:---------:| | ||
| 方块 | ServerEvents.blockLootTables | [方块类型战利品表](./Block.md) | | ||
| 实体 | ServerEvents.entityLootTables | [实体类型战利品表](./Entity.md) | | ||
| 钓鱼 | ServerEvents.fishingLootTables | [钓鱼类型战利品表](./Fish.md) | | ||
| 礼物 | ServerEvents.fishingLootTables | [礼物类型战利品表](./Gift.md) | | ||
| 箱子 | ServerEvents.chestLootTables | [箱子类型战利品表](./Chest.md) | | ||
| 通用 | ServerEvents.genericLootTables | [通用类型战利品表](./Generic.md) | |
File renamed without changes.
105 changes: 0 additions & 105 deletions
105
docs/zh/modpack/kubejs/1.20.1/Introduction/LootTable/LootEntry.md
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.