更新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

@@ -334,6 +334,7 @@ method in mod.server.component.itemCompServer.ItemCompServer
| itemCategory |str| 创造栏分类 |
| itemType |str| 物品类型 |
| customItemType |str| 自定义物品类型 |
| tags | list(str) | 物品的tags列表如['minecraft:is_food']
| customTips |str| 自定义物品/方块tips |
| itemTierLevel |int| 工具等级 |
| fuelDuration |float| 燃料时长 |
@@ -344,6 +345,7 @@ method in mod.server.component.itemCompServer.ItemCompServer
| armorSlot |int| 防具槽位 |
| armorToughness |int| 防具韧性 |
| armorKnockbackResistance |float| 防具击退抗性 |
| enchant_slot_type |int| 附魔槽位枚举标志 <a href="../../../mcguide/20-玩法开发/15-自定义游戏内容/11-自定义附魔文档.html">自定义附魔文档</a>
- 部分原版物品较为特殊,获取不到个别字段的返回值
方块类燃料获取不到燃料时长弓、弩获取不到武器攻击力蛋糕获取不到营养值和饱食度马铠获取不到防具防御力上述物品获取对应字段返回值为0
- 创造栏分类说明
@@ -392,7 +394,9 @@ method in mod.server.component.itemCompServer.ItemCompServer
```python
import mod.server.extraServerApi as serverApi
comp = serverApi.GetEngineCompFactory().CreateItem(levelId)
comp.GetItemBasicInfo("minecraft:bow")
info = comp.GetItemBasicInfo("minecraft:bow")
enchant_slot_type = info["enchant_slot_type"]
support_sword = (enchant_slot_type & EnchantSlotType.SWORD) > 0
```
@@ -432,6 +436,7 @@ method in mod.client.component.itemCompClient.ItemCompClient
| itemCategory |str| 创造栏分类 |
| itemType |str| 物品类型 |
| customItemType |str| 自定义物品类型 |
| tags | list(str) | 物品的tags列表如['minecraft:is_food']
| customTips |str| 自定义物品/方块tips |
| itemTierLevel |int| 工具等级 |
| fuelDuration |float| 燃料时长 |
@@ -442,6 +447,7 @@ method in mod.client.component.itemCompClient.ItemCompClient
| armorSlot |int| 防具槽位 |
| armorToughness |int| 防具韧性 |
| armorKnockbackResistance |float| 防具击退抗性 |
| enchant_slot_type |int| 附魔槽位枚举标志 <a href="../../../mcguide/20-玩法开发/15-自定义游戏内容/11-自定义附魔文档.html">自定义附魔文档</a>
- 部分原版物品较为特殊,获取不到个别字段的返回值
方块类燃料获取不到燃料时长弓、弩获取不到武器攻击力蛋糕获取不到营养值和饱食度马铠获取不到防具防御力上述物品获取对应字段返回值为0
- id_aux字段的示例
@@ -514,7 +520,9 @@ method in mod.client.component.itemCompClient.ItemCompClient
```python
import mod.client.extraClientApi as clientApi
comp = clientApi.GetEngineCompFactory().CreateItem(levelId)
comp.GetItemBasicInfo("minecraft:bow")
info = comp.GetItemBasicInfo("minecraft:bow")
enchant_slot_type = info["enchant_slot_type"]
support_sword = (enchant_slot_type & EnchantSlotType.SWORD) > 0
```