更新3.4API
This commit is contained in:
@@ -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
|
||||
```
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user