更新3.4API

This commit is contained in:
boybook
2025-06-27 23:59:47 +08:00
parent c0f98b179b
commit 12738a142c
52 changed files with 1146 additions and 292 deletions

View File

@@ -228,6 +228,36 @@ print(comp.GetPlayerCurLevelExp(playerId))
## GetPlayerCurrentExhaustionValue
<span style="display:inline;color:#ff5555">服务端</span>
method in mod.server.component.playerCompServer.PlayerCompServer
- 描述
获取玩家foodExhaustionLevel的当前消耗度。详见<a href="https://zh.minecraft.wiki/w/%E9%A5%A5%E9%A5%BF#%E6%9C%BA%E5%88%B6">消耗度介绍</a>
- 参数
- 返回值
| <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- |
| float | 玩家foodExhaustionLevel的当前消耗度, |
- 示例
```python
import mod.server.extraServerApi as serverApi
comp = serverApi.GetEngineCompFactory().CreatePlayer(playerId)
value = comp.GetPlayerCurrentExhaustionValue()
```
## GetPlayerExp
<span style="display:inline;color:#ff5555">服务端</span><span style="display:inline;color:#7575f9">客户端</span>
@@ -699,6 +729,38 @@ comp.SetEnchantmentSeed(32)
## SetPlayerCurrentExhaustionValue
<span style="display:inline;color:#ff5555">服务端</span>
method in mod.server.component.playerCompServer.PlayerCompServer
- 描述
设置玩家foodExhaustionLevel的当前消耗度。详见<a href="https://zh.minecraft.wiki/w/%E9%A5%A5%E9%A5%BF#%E6%9C%BA%E5%88%B6">消耗度介绍</a>
- 参数
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- | :--- |
| value | float | 当前消耗度 |
- 返回值
| <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- |
| bool | 是否设置成功 |
- 示例
```python
import mod.server.extraServerApi as serverApi
comp = serverApi.GetEngineCompFactory().CreatePlayer(playerId)
result = comp.SetPlayerCurrentExhaustionValue(2.0)
```
## SetPlayerHealthLevel
<span style="display:inline;color:#ff5555">服务端</span>