2.6
This commit is contained in:
@@ -634,6 +634,142 @@ print(comp.GetPlayerTotalExp(playerId))
|
||||
|
||||
|
||||
|
||||
## IsHighLevelMultiJointOfficialSkin
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.component.gameCompClient.GameComponentClient
|
||||
|
||||
- 描述
|
||||
|
||||
获取玩家穿戴的皮肤是否为史诗及以上的多关节官方4d皮肤 在接收到 UpdatePlayerSkinClientEvent 事件后调用 此事件在客户端接收到玩家皮肤信息同步后触发 参数仅playerId
|
||||
|
||||
- 参数
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| playerId | str | 玩家ID |
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| bool | 史诗及以上的多关节官方4d皮肤返回True |
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
self.ListenForEvent('Minecraft', "Engine", 'UpdatePlayerSkinClientEvent', self, self.onUpdatePlayerSkinClientEvent)
|
||||
def onUpdatePlayerSkinClientEvent(self,args):
|
||||
import mod.client.extraClientApi as clientApi
|
||||
comp = clientApi.GetEngineCompFactory().CreateGame(levelId)
|
||||
comp.IsHighLevelMultiJointOfficialSkin(args['playerId'])
|
||||
```
|
||||
|
||||
|
||||
|
||||
## IsHighLevelOfficialSkin
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.component.gameCompClient.GameComponentClient
|
||||
|
||||
- 描述
|
||||
|
||||
获取玩家穿戴的皮肤是否为史诗及以上的官方4d皮肤 在接收到 UpdatePlayerSkinClientEvent 事件后调用 此事件在客户端接收到玩家皮肤信息同步后触发 参数仅playerId
|
||||
|
||||
- 参数
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| playerId | str | 玩家ID |
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| bool | 史诗及以上的官方4d皮肤返回True |
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
self.ListenForEvent('Minecraft', "Engine", 'UpdatePlayerSkinClientEvent', self, self.onUpdatePlayerSkinClientEvent)
|
||||
def onUpdatePlayerSkinClientEvent(self,args):
|
||||
import mod.client.extraClientApi as clientApi
|
||||
comp = clientApi.GetEngineCompFactory().CreateGame(levelId)
|
||||
comp.IsHighLevelOfficialSkin(args['playerId'])
|
||||
```
|
||||
|
||||
|
||||
|
||||
## IsMultiJointOfficialSkin
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.component.gameCompClient.GameComponentClient
|
||||
|
||||
- 描述
|
||||
|
||||
获取玩家穿戴的皮肤是否为多关节官方4d皮肤 在接收到 UpdatePlayerSkinClientEvent 事件后调用 此事件在客户端接收到玩家皮肤信息同步后触发 参数仅playerId
|
||||
|
||||
- 参数
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| playerId | str | 玩家ID |
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| bool | 多关节官方4d皮肤返回True |
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
self.ListenForEvent('Minecraft', "Engine", 'UpdatePlayerSkinClientEvent', self, self.onUpdatePlayerSkinClientEvent)
|
||||
def onUpdatePlayerSkinClientEvent(self,args):
|
||||
import mod.client.extraClientApi as clientApi
|
||||
comp = clientApi.GetEngineCompFactory().CreateGame(levelId)
|
||||
comp.IsMultiJointOfficialSkin(args['playerId'])
|
||||
```
|
||||
|
||||
|
||||
|
||||
## IsOfficialSkin
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
method in mod.client.component.gameCompClient.GameComponentClient
|
||||
|
||||
- 描述
|
||||
|
||||
获取玩家穿戴的皮肤是否为官方4d皮肤 在接收到 UpdatePlayerSkinClientEvent 事件后调用 此事件在客户端接收到玩家皮肤信息同步后触发 参数仅playerId
|
||||
|
||||
- 参数
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| playerId | str | 玩家ID |
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| bool | 官方4d皮肤返回True |
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
self.ListenForEvent('Minecraft', "Engine", 'UpdatePlayerSkinClientEvent', self, self.onUpdatePlayerSkinClientEvent)
|
||||
def onUpdatePlayerSkinClientEvent(self,args):
|
||||
import mod.client.extraClientApi as clientApi
|
||||
comp = clientApi.GetEngineCompFactory().CreateGame(levelId)
|
||||
comp.IsOfficialSkin(args['playerId'])
|
||||
```
|
||||
|
||||
|
||||
|
||||
## IsPlayerNaturalRegen
|
||||
|
||||
<span style="display:inline;color:#ff5555">服务端</span>
|
||||
|
||||
@@ -405,7 +405,9 @@ method in mod.client.component.actorRenderCompClient.ActorRenderCompClient
|
||||
|
||||
- 参数
|
||||
|
||||
无
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| clearBindParticle | bool | 是否清除粒子,默认为False |
|
||||
|
||||
- 返回值
|
||||
|
||||
|
||||
@@ -40,6 +40,10 @@ sidebarDepth: 1
|
||||
| [GetPlayerStarveTick](属性.md#getplayerstarvetick) | <span style="display:inline;color:#ff5555">服务端</span> | 获取玩家饥饿掉血速度,当饥饿值小于饥饿临界值时会自动扣除血量,开启饥饿值且开启饥饿掉血时有效。原版默认值为80刻(即每4秒)扣除1点血量 |
|
||||
| [GetPlayerTotalExp](属性.md#getplayertotalexp) | <span style="display:inline;color:#ff5555">服务端</span> | 获取玩家的总经验值 |
|
||||
| [GetPlayerTotalExp](属性.md#getplayertotalexp) | <span style="display:inline;color:#7575f9">客户端</span> | 获取玩家的总经验值 |
|
||||
| [IsHighLevelMultiJointOfficialSkin](属性.md#ishighlevelmultijointofficialskin) | <span style="display:inline;color:#7575f9">客户端</span> | 获取玩家穿戴的皮肤是否为史诗及以上的多关节官方4d皮肤 在接收到 UpdatePlayerSkinClientEvent 事件后调用 此事件在客户端接收到玩家皮肤信息同步后触发 参数仅playerId |
|
||||
| [IsHighLevelOfficialSkin](属性.md#ishighlevelofficialskin) | <span style="display:inline;color:#7575f9">客户端</span> | 获取玩家穿戴的皮肤是否为史诗及以上的官方4d皮肤 在接收到 UpdatePlayerSkinClientEvent 事件后调用 此事件在客户端接收到玩家皮肤信息同步后触发 参数仅playerId |
|
||||
| [IsMultiJointOfficialSkin](属性.md#ismultijointofficialskin) | <span style="display:inline;color:#7575f9">客户端</span> | 获取玩家穿戴的皮肤是否为多关节官方4d皮肤 在接收到 UpdatePlayerSkinClientEvent 事件后调用 此事件在客户端接收到玩家皮肤信息同步后触发 参数仅playerId |
|
||||
| [IsOfficialSkin](属性.md#isofficialskin) | <span style="display:inline;color:#7575f9">客户端</span> | 获取玩家穿戴的皮肤是否为官方4d皮肤 在接收到 UpdatePlayerSkinClientEvent 事件后调用 此事件在客户端接收到玩家皮肤信息同步后触发 参数仅playerId |
|
||||
| [IsPlayerNaturalRegen](属性.md#isplayernaturalregen) | <span style="display:inline;color:#ff5555">服务端</span> | 是否开启玩家自然恢复,当饥饿值大于等于健康临界值时会自动恢复血量,开启饥饿值且开启自然恢复时有效。原版默认开启 |
|
||||
| [IsPlayerNaturalStarve](属性.md#isplayernaturalstarve) | <span style="display:inline;color:#ff5555">服务端</span> | 是否开启玩家饥饿掉血,当饥饿值小于饥饿临界值时会自动恢复血量,开启饥饿值且开启饥饿掉血时有效。原版默认开启 |
|
||||
| [SetEnchantmentSeed](属性.md#setenchantmentseed) | <span style="display:inline;color:#ff5555">服务端</span> | 设置玩家的附魔种子,该种子会决定附魔台上准备附魔的装备的附魔项 |
|
||||
@@ -88,6 +92,7 @@ sidebarDepth: 1
|
||||
| [IsOnLadder](行为.md#isonladder) | <span style="display:inline;color:#7575f9">客户端</span> | 获取玩家是否在梯子/藤蔓上 |
|
||||
| [IsPlayerCanFly](行为.md#isplayercanfly) | <span style="display:inline;color:#ff5555">服务端</span> | 获取玩家能否飞行 |
|
||||
| [IsPlayerFlying](行为.md#isplayerflying) | <span style="display:inline;color:#ff5555">服务端</span> | 获取玩家是否在飞行 |
|
||||
| [OpenNeteaseContainer](行为.md#openneteasecontainer) | <span style="display:inline;color:#ff5555">服务端</span> | 打开自定义容器界面,不依赖于方块。该界面的物品数据需由开发者自行维护。 |
|
||||
| [OpenWorkBench](行为.md#openworkbench) | <span style="display:inline;color:#ff5555">服务端</span> | 在玩家当前位置打开工作台UI,不依赖于工作台方块 |
|
||||
| [PickUpItemEntity](行为.md#pickupitementity) | <span style="display:inline;color:#ff5555">服务端</span> | 某个Player拾取物品ItemEntity |
|
||||
| [PlayerAttackEntity](行为.md#playerattackentity) | <span style="display:inline;color:#ff5555">服务端</span> | 玩家使用手持武器攻击某个生物 |
|
||||
|
||||
@@ -919,6 +919,50 @@ comp.IsPlayerFlying()
|
||||
|
||||
|
||||
|
||||
## OpenNeteaseContainer
|
||||
|
||||
<span style="display:inline;color:#ff5555">服务端</span>
|
||||
|
||||
method in mod.server.component.playerCompServer.PlayerCompServer
|
||||
|
||||
- 描述
|
||||
|
||||
打开自定义容器界面,不依赖于方块。该界面的物品数据需由开发者自行维护。
|
||||
|
||||
- 参数
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| screenName | str | 打开的容器ui的命名空间,格式[namespace.screenName] |
|
||||
| customDescription | str | 打开的容器ui的标题(复用原版ui时生效) |
|
||||
| isCloseReturnItem | bool | 关闭容器界面时,是否返还物品到背包;默认为False(不返还),由开发者维护物品数据的存储。 |
|
||||
|
||||
- 返回值
|
||||
|
||||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- |
|
||||
| bool | 返回True则执行成功,不代表界面已打开 |
|
||||
|
||||
- 备注
|
||||
- 参数含义以及自定义容器ui json的编写,参考[自定义容器](../../../../mcguide/20-玩法开发/15-自定义游戏内容/2-自定义方块/3-特殊方块/11-自定义容器.md)教程。
|
||||
- collection_name需指定为`netease_ui_container`。
|
||||
- 如果isCloseReturnItem为False,将在关闭界面后,`容器内的物品不会返还到背包`。
|
||||
- 可使用[GetPlayerUIItem](../方块/容器.md#getplayeruiitem)、[SetPlayerUIItem](../方块/容器.md#setplayeruiitem)接口来获取、设置容器内的物品。
|
||||
- 该接口打开的容器,可触发[PlayerTryAddCustomContainerItemServerEvent](../../事件/物品.md#playertryaddcustomcontaineritemserverevent)、[PlayerTryPutCustomContainerItemServerEvent](../../事件/物品.md#playertryputcustomcontaineritemserverevent)、[PlayerTryRemoveCustomContainerItemServerEvent](../../事件/物品.md#playertryremovecustomcontaineritemserverevent)以及对应的客户端事件。
|
||||
- 可通过监听[PushScreenEvent](../../事件/UI.md#pushscreenevent),来做容器内格子物品的初始化逻辑;建议每一个ui namespace单独对应一种功能,以免无法正确区分容器界面。
|
||||
- 如出现“failed to create root control”等断言,请检查ui json的编写是否正确。
|
||||
- 如出现物品无法放入容器界面、或者无法移动物品,请检查ui json的是否使用了netease_ui_container。
|
||||
|
||||
- 示例
|
||||
|
||||
```python
|
||||
import mod.server.extraServerApi as serverApi
|
||||
comp = serverApi.GetEngineCompFactory().CreatePlayer(playerId)
|
||||
comp.OpenNeteaseContainer("netease_container.netease_custom_container_screen", "容器标题")
|
||||
```
|
||||
|
||||
|
||||
|
||||
## OpenWorkBench
|
||||
|
||||
<span style="display:inline;color:#ff5555">服务端</span>
|
||||
|
||||
Reference in New Issue
Block a user