更新3.3

This commit is contained in:
boybook
2025-03-18 14:46:12 +08:00
parent e0e8ad3192
commit 481c844a80
11938 changed files with 149901 additions and 23781 deletions

View File

@@ -27,6 +27,7 @@ method in mod.server.component.blockInfoCompServer.BlockInfoComponentServer
- 备注
- 基本信息字典中部分字段只在自定义方块时加上指定组件才会取到数据,具体见<a href="../../../../mcguide/20-玩法开发/10-基本概念/1-我的世界基础概念.html#方块基本信息字典#方块基本信息字典">方块基本信息字典</a>
- 历史原因,<a href="../../../../mcguide/20-玩法开发/10-基本概念/1-我的世界基础概念.html#方块基本信息字典#方块基本信息字典">方块基本信息字典</a>中的tier中的digger值类型为int。shovel(铲)为 0 pickaxe(镐)为 1 hatchet(斧)为 2 hoe(锄)为 3。
- 示例
@@ -38,6 +39,68 @@ blockDict = comp.GetBlockBasicInfo("minecraft:stone")
## GetBlockTags
<span style="display:inline;color:#ff5555">服务端</span>
method in mod.server.component.blockInfoCompServer.BlockInfoComponentServer
- 描述
获取方块在tags:*中定义的tags列表
- 参数
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- | :--- |
| blockName | str | 方块identifierge |
- 返回值
| <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- |
| list(str) | 方块tags列表 |
- 示例
```python
import mod.server.extraServerApi as serverApi
comp = serverApi.GetEngineCompFactory().CreateBlockInfo(levelId)
comp.GetBlockTags("minecraft:stone")
```
## GetLoadBlocks
<span style="display:inline;color:#ff5555">服务端</span>
method in mod.server.component.blockInfoCompServer.BlockInfoComponentServer
- 描述
获取已经加载的方块id
- 参数
- 返回值
| <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- |
| List | 方块id列表 |
- 示例
```python
import mod.server.extraServerApi as serverApi
comp = serverApi.GetEngineCompFactory().CreateBlockInfo(levelId)
suc = comp.GetLoadBlocks()
```
## SetBlockBasicInfo
<span style="display:inline;color:#ff5555">服务端</span>
@@ -78,3 +141,43 @@ blockDict = comp.SetBlockBasicInfo("minecraft:stone", {"blockLightEmission":1,
## SetChestLootTable
<span style="display:inline;color:#ff5555">服务端</span>
method in mod.server.component.blockInfoCompServer.BlockInfoComponentServer
- 描述
设置箱子战利品表
- 参数
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- | :--- |
| blockPos | tuple(int,int,int) | 方块的坐标 |
| dimensionId | int | 方块所在的维度 |
| lootTable | str | 战利品表位置字符串,如"loot_tables/entities/zombie.json" |
| isIgnoreSpilt | bool | 是否屏蔽随机分堆默认为False |
- 返回值
| <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- |
| bool | 是否设置成功 |
- 备注
- 仅支持未打开过的箱子,若箱子已经打开过,则设置失败
- 维度需要已经加载。如有玩家在相应维度上,则算维度已加载,若完全没玩家在对应维度上,则维度未加载
- 末影箱仍是箱子的一种,但是末影箱本身并不直接存储物品。因此虽然设置战利品表返回成功,实际在打开末影箱时,并不会用到战利品表!
- 示例
```python
import mod.server.extraServerApi as serverApi
comp = serverApi.GetEngineCompFactory().CreateBlockInfo(levelId)
suc = comp.SetChestLootTable(blockPos, dimensionId, lootTable)
```