2.6
This commit is contained in:
@@ -12,8 +12,8 @@ sidebarDepth: 1
|
||||
| [ActorUseItemClientEvent](物品.md#actoruseitemclientevent) | <span style="display:inline;color:#7575f9">客户端</span> | 触发时机:玩家使用物品时客户端抛出的事件(比较特殊不走该事件的例子:1)染料对有水的炼药锅使用;2)盔甲架装备盔甲);3)喝牛奶 |
|
||||
| [ActorUseItemServerEvent](物品.md#actoruseitemserverevent) | <span style="display:inline;color:#ff5555">服务端</span> | 触发时机:玩家使用物品生效之前服务端抛出的事件(比较特殊不走该事件的例子:1)染料对有水的炼药锅使用;2)盔甲架装备盔甲) |
|
||||
| [AnvilCreateResultItemAfterClientEvent](物品.md#anvilcreateresultitemafterclientevent) | <span style="display:inline;color:#7575f9">客户端</span> | 玩家点击铁砧合成得到的物品时抛出的事件。 |
|
||||
| [ClientItemTryUseEvent](物品.md#clientitemtryuseevent) | <span style="display:inline;color:#7575f9">客户端</span> | 玩家点击右键尝试使用物品时客户端抛出的事件,可以通过设置cancel为True取消使用物品。注:ClientItemTryUseEvent事件设置cancel时即可取消使用,无需服务端ServerItemTryUseEvent再次cancel,且服务端事件将不再触发。 |
|
||||
| [ClientItemUseOnEvent](物品.md#clientitemuseonevent) | <span style="display:inline;color:#7575f9">客户端</span> | 玩家在对方块使用物品时客户端抛出的事件。注:事件设置ret = True 时即可取消使用,无需服务端再次设置ServerItemUseOnEvent取消,且服务端事件将不再触发。 |
|
||||
| [ClientItemTryUseEvent](物品.md#clientitemtryuseevent) | <span style="display:inline;color:#7575f9">客户端</span> | 玩家点击右键尝试使用物品时客户端抛出的事件,可以通过设置cancel为True取消使用物品。 |
|
||||
| [ClientItemUseOnEvent](物品.md#clientitemuseonevent) | <span style="display:inline;color:#7575f9">客户端</span> | 玩家在对方块使用物品时客户端抛出的事件。 |
|
||||
| [ClientShapedRecipeTriggeredEvent](物品.md#clientshapedrecipetriggeredevent) | <span style="display:inline;color:#7575f9">客户端</span> | 玩家合成物品时触发 |
|
||||
| [ContainerItemChangedServerEvent](物品.md#containeritemchangedserverevent) | <span style="display:inline;color:#ff5555">服务端</span> | 容器物品变化事件 |
|
||||
| [CraftItemOutputChangeServerEvent](物品.md#craftitemoutputchangeserverevent) | <span style="display:inline;color:#ff5555">服务端</span> | 玩家从容器拿出生成物品时触发 |
|
||||
@@ -23,6 +23,8 @@ sidebarDepth: 1
|
||||
| [InventoryItemChangedClientEvent](物品.md#inventoryitemchangedclientevent) | <span style="display:inline;color:#7575f9">客户端</span> | 玩家背包物品变化时客户端抛出的事件。 |
|
||||
| [InventoryItemChangedServerEvent](物品.md#inventoryitemchangedserverevent) | <span style="display:inline;color:#ff5555">服务端</span> | 玩家背包物品变化时服务端抛出的事件。 |
|
||||
| [ItemDurabilityChangedServerEvent](物品.md#itemdurabilitychangedserverevent) | <span style="display:inline;color:#ff5555">服务端</span> | 物品耐久度变化事件 |
|
||||
| [ItemPullOutCustomContainerServerEvent](物品.md#itempulloutcustomcontainerserverevent) | <span style="display:inline;color:#ff5555">服务端</span> | 漏出物品到漏斗时触发该事件 |
|
||||
| [ItemPushInCustomContainerServerEvent](物品.md#itempushincustomcontainerserverevent) | <span style="display:inline;color:#ff5555">服务端</span> | 漏斗漏入物品时触发该事件 |
|
||||
| [ItemReleaseUsingClientEvent](物品.md#itemreleaseusingclientevent) | <span style="display:inline;color:#7575f9">客户端</span> | 触发时机:释放正在使用的物品 |
|
||||
| [ItemReleaseUsingServerEvent](物品.md#itemreleaseusingserverevent) | <span style="display:inline;color:#ff5555">服务端</span> | 触发时机:释放正在使用的物品时 |
|
||||
| [ItemUseAfterServerEvent](物品.md#itemuseafterserverevent) | <span style="display:inline;color:#ff5555">服务端</span> | 玩家在使用物品之后服务端抛出的事件。 |
|
||||
@@ -37,10 +39,15 @@ sidebarDepth: 1
|
||||
| [OnPlayerBlockedByShieldBeforeServerEvent](物品.md#onplayerblockedbyshieldbeforeserverevent) | <span style="display:inline;color:#ff5555">服务端</span> | 触发时机:玩家使用盾牌抵挡伤害之前触发 |
|
||||
| [PlayerDropItemServerEvent](物品.md#playerdropitemserverevent) | <span style="display:inline;color:#ff5555">服务端</span> | 触发时机:玩家丢弃物品时触发 |
|
||||
| [PlayerPickupArrowServerEvent](物品.md#playerpickuparrowserverevent) | <span style="display:inline;color:#ff5555">服务端</span> | 玩家即将捡起抛射物时触发,包括使用"netease:pick_up"的自定义抛射物 |
|
||||
| [PlayerTryAddCustomContainerItemClientEvent](物品.md#playertryaddcustomcontaineritemclientevent) | <span style="display:inline;color:#7575f9">客户端</span> | 玩家尝试将物品添加到自定义容器时触发该事件 |
|
||||
| [PlayerTryAddCustomContainerItemServerEvent](物品.md#playertryaddcustomcontaineritemserverevent) | <span style="display:inline;color:#ff5555">服务端</span> | 玩家尝试将物品添加到自定义容器时触发该事件 |
|
||||
| [PlayerTryDropItemClientEvent](物品.md#playertrydropitemclientevent) | <span style="display:inline;color:#7575f9">客户端</span> | 触发时机:玩家丢弃物品时触发 |
|
||||
| [PlayerTryPutCustomContainerItemClientEvent](物品.md#playertryputcustomcontaineritemclientevent) | <span style="display:inline;color:#7575f9">客户端</span> | 玩家尝试将物品放入自定义容器时触发该事件 |
|
||||
| [PlayerTryPutCustomContainerItemServerEvent](物品.md#playertryputcustomcontaineritemserverevent) | <span style="display:inline;color:#ff5555">服务端</span> | 玩家尝试将物品放入自定义容器时触发该事件 |
|
||||
| [ServerItemTryUseEvent](物品.md#serveritemtryuseevent) | <span style="display:inline;color:#ff5555">服务端</span> | 玩家点击右键尝试使用物品时服务端抛出的事件。注:ClientItemTryUseEvent的cancel设置为True时,服务端事件不会被触发了。 |
|
||||
| [ServerItemUseOnEvent](物品.md#serveritemuseonevent) | <span style="display:inline;color:#ff5555">服务端</span> | 玩家在对方块使用物品之前服务端抛出的事件。注:客户端事件ClientItemUseOnEvent设置ret设置为True时,服务端不再会接受到这个事件。 |
|
||||
| [PlayerTryRemoveCustomContainerItemClientEvent](物品.md#playertryremovecustomcontaineritemclientevent) | <span style="display:inline;color:#7575f9">客户端</span> | 玩家尝试从自定义容器中移除物品时触发该事件 |
|
||||
| [PlayerTryRemoveCustomContainerItemServerEvent](物品.md#playertryremovecustomcontaineritemserverevent) | <span style="display:inline;color:#ff5555">服务端</span> | 玩家尝试从自定义容器中移除物品时触发该事件 |
|
||||
| [ServerItemTryUseEvent](物品.md#serveritemtryuseevent) | <span style="display:inline;color:#ff5555">服务端</span> | 玩家点击右键尝试使用物品时服务端抛出的事件。 |
|
||||
| [ServerItemUseOnEvent](物品.md#serveritemuseonevent) | <span style="display:inline;color:#ff5555">服务端</span> | 玩家在对方块使用物品之前服务端抛出的事件。 |
|
||||
| [ServerPlayerTryTouchEvent](物品.md#serverplayertrytouchevent) | <span style="display:inline;color:#ff5555">服务端</span> | 玩家即将捡起物品时触发 |
|
||||
| [ShearsUseToBlockBeforeServerEvent](物品.md#shearsusetoblockbeforeserverevent) | <span style="display:inline;color:#ff5555">服务端</span> | 触发时机:实体手持剪刀对方块使用时,有剪刀特殊效果的方块会在服务端线程触发该事件 |
|
||||
| [StartUsingItemClientEvent](物品.md#startusingitemclientevent) | <span style="display:inline;color:#7575f9">客户端</span> | 玩家使用物品(目前仅支持Bucket(奶桶)、Trident(三叉戟)、RangedWeapon(弓)、Food(食物)、Potion(药水)、Crossbow(弩))时抛出 |
|
||||
@@ -179,7 +186,7 @@ sidebarDepth: 1
|
||||
|
||||
- 描述
|
||||
|
||||
玩家点击右键尝试使用物品时客户端抛出的事件,可以通过设置cancel为True取消使用物品。注:ClientItemTryUseEvent事件设置cancel时即可取消使用,无需服务端ServerItemTryUseEvent再次cancel,且服务端事件将不再触发。
|
||||
玩家点击右键尝试使用物品时客户端抛出的事件,可以通过设置cancel为True取消使用物品。
|
||||
|
||||
- 参数
|
||||
|
||||
@@ -194,6 +201,7 @@ sidebarDepth: 1
|
||||
无
|
||||
|
||||
- 备注
|
||||
- ClientItemTryUseEvent事件设置cancel时即可取消使用,无需服务端ServerItemTryUseEvent再次cancel,且服务端事件将不再触发。
|
||||
- ServerItemTryUseEvent/ClientItemTryUseEvent不能取消对方块使用物品的行为,如使用生物蛋,使用桶倒出/收集,使用打火石点燃草等;如果想要取消这种行为,请使用ClientItemUseOnEvent和ServerItemUseOnEvent
|
||||
|
||||
在零件中直接声明一个同名函数,即可完成监听,详情参考<a href="../../../mcguide/20-玩法开发/14-预设玩法编程/12-深入理解零件/0-零件开发.html#零件事件">零件事件</a>
|
||||
@@ -205,7 +213,7 @@ sidebarDepth: 1
|
||||
|
||||
- 描述
|
||||
|
||||
玩家在对方块使用物品时客户端抛出的事件。注:事件设置ret = True 时即可取消使用,无需服务端再次设置ServerItemUseOnEvent取消,且服务端事件将不再触发。
|
||||
玩家在对方块使用物品时客户端抛出的事件。
|
||||
|
||||
- 参数
|
||||
|
||||
@@ -228,6 +236,9 @@ sidebarDepth: 1
|
||||
|
||||
无
|
||||
|
||||
- 备注
|
||||
- 事件设置ret = True 时即可取消使用,无需服务端再次设置ServerItemUseOnEvent取消,且服务端事件将不再触发。
|
||||
|
||||
在零件中直接声明一个同名函数,即可完成监听,详情参考<a href="../../../mcguide/20-玩法开发/14-预设玩法编程/12-深入理解零件/0-零件开发.html#零件事件">零件事件</a>
|
||||
|
||||
|
||||
@@ -521,6 +532,58 @@ def OnCraftItemOutputChangeServerEvent(self, args):
|
||||
在零件中直接声明一个同名函数,即可完成监听,详情参考<a href="../../../mcguide/20-玩法开发/14-预设玩法编程/12-深入理解零件/0-零件开发.html#零件事件">零件事件</a>
|
||||
|
||||
|
||||
## ItemPullOutCustomContainerServerEvent
|
||||
|
||||
<span style="display:inline;color:#ff5555">服务端</span>
|
||||
|
||||
- 描述
|
||||
|
||||
漏出物品到漏斗时触发该事件
|
||||
|
||||
- 参数
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| itemDict | dict | 漏斗漏出物品的<a href="../../../mcguide/20-玩法开发/10-基本概念/1-我的世界基础概念.html#物品信息字典#物品信息字典">物品信息字典</a> |
|
||||
| collectionName | str | 漏出物品的容器名称,目前仅支持netease_container |
|
||||
| collectionIndex | int | 漏出物品的容器索引 |
|
||||
| x | int | 容器方块x坐标 |
|
||||
| y | int | 容器方块y坐标 |
|
||||
| z | int | 容器方块z坐标 |
|
||||
| cancel | bool | 是否取消该操作,默认为false,事件中改为true时拒绝此次漏出物品的操作 |
|
||||
|
||||
- 返回值
|
||||
|
||||
无
|
||||
|
||||
|
||||
|
||||
## ItemPushInCustomContainerServerEvent
|
||||
|
||||
<span style="display:inline;color:#ff5555">服务端</span>
|
||||
|
||||
- 描述
|
||||
|
||||
漏斗漏入物品时触发该事件
|
||||
|
||||
- 参数
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| itemDict | dict | 漏斗漏入物品的<a href="../../../mcguide/20-玩法开发/10-基本概念/1-我的世界基础概念.html#物品信息字典#物品信息字典">物品信息字典</a> |
|
||||
| collectionName | str | 目标容器名称,目前仅支持netease_container |
|
||||
| collectionIndex | int | 目标容器索引 |
|
||||
| x | int | 容器方块x坐标 |
|
||||
| y | int | 容器方块y坐标 |
|
||||
| z | int | 容器方块z坐标 |
|
||||
| cancel | bool | 是否取消该操作,默认为false,事件中改为true时拒绝此次漏入物品的操作 |
|
||||
|
||||
- 返回值
|
||||
|
||||
无
|
||||
|
||||
|
||||
|
||||
## ItemReleaseUsingClientEvent
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
@@ -882,6 +945,68 @@ def OnCraftItemOutputChangeServerEvent(self, args):
|
||||
在零件中直接声明一个同名函数,即可完成监听,详情参考<a href="../../../mcguide/20-玩法开发/14-预设玩法编程/12-深入理解零件/0-零件开发.html#零件事件">零件事件</a>
|
||||
|
||||
|
||||
## PlayerTryAddCustomContainerItemClientEvent
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
- 描述
|
||||
|
||||
玩家尝试将物品添加到自定义容器时触发该事件
|
||||
|
||||
- 参数
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| itemDict | dict | 尝试添加物品的<a href="../../../mcguide/20-玩法开发/10-基本概念/1-我的世界基础概念.html#物品信息字典#物品信息字典">物品信息字典</a> |
|
||||
| collectionName | str | 放入容器名称,对应容器json中"custom_description"字段 |
|
||||
| collectionType | str | 放入容器类型,目前仅支持netease_container和netease_ui_container |
|
||||
| collectionIndex | int | 放入容器索引 |
|
||||
| x | int | 容器方块x坐标 |
|
||||
| y | int | 容器方块y坐标 |
|
||||
| z | int | 容器方块z坐标 |
|
||||
| cancel | bool | 是否取消该操作,默认为false,事件中改为true时拒绝此次放入自定义容器的操作 |
|
||||
|
||||
- 返回值
|
||||
|
||||
无
|
||||
|
||||
- 备注
|
||||
- 容器内物品移动,合堆,分堆的操作会分多次事件触发并且顺序不定,编写逻辑时请勿依赖事件触发顺序
|
||||
- cancel取消本次操作后不会触发对应服务端事件
|
||||
|
||||
|
||||
|
||||
## PlayerTryAddCustomContainerItemServerEvent
|
||||
|
||||
<span style="display:inline;color:#ff5555">服务端</span>
|
||||
|
||||
- 描述
|
||||
|
||||
玩家尝试将物品添加到自定义容器时触发该事件
|
||||
|
||||
- 参数
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| itemDict | dict | 尝试添加物品的<a href="../../../mcguide/20-玩法开发/10-基本概念/1-我的世界基础概念.html#物品信息字典#物品信息字典">物品信息字典</a> |
|
||||
| collectionName | str | 放入容器名称,对应容器json中"custom_description"字段 |
|
||||
| collectionType | str | 放入容器类型,目前仅支持netease_container和netease_ui_container |
|
||||
| collectionIndex | int | 放入容器索引 |
|
||||
| playerId | str | 玩家id |
|
||||
| x | int | 容器方块x坐标 |
|
||||
| y | int | 容器方块y坐标 |
|
||||
| z | int | 容器方块z坐标 |
|
||||
|
||||
- 返回值
|
||||
|
||||
无
|
||||
|
||||
- 备注
|
||||
- 容器内物品移动,合堆,分堆的操作会分多次事件触发并且顺序不定,编写逻辑时请勿依赖事件触发顺序
|
||||
|
||||
在零件中直接声明一个同名函数,即可完成监听,详情参考<a href="../../../mcguide/20-玩法开发/14-预设玩法编程/12-深入理解零件/0-零件开发.html#零件事件">零件事件</a>
|
||||
|
||||
|
||||
## PlayerTryDropItemClientEvent
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
@@ -905,6 +1030,39 @@ def OnCraftItemOutputChangeServerEvent(self, args):
|
||||
在零件中直接声明一个同名函数,即可完成监听,详情参考<a href="../../../mcguide/20-玩法开发/14-预设玩法编程/12-深入理解零件/0-零件开发.html#零件事件">零件事件</a>
|
||||
|
||||
|
||||
## PlayerTryPutCustomContainerItemClientEvent
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
- 描述
|
||||
|
||||
玩家尝试将物品放入自定义容器时触发该事件
|
||||
|
||||
- 参数
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| itemDict | dict | 尝试放入物品的<a href="../../../mcguide/20-玩法开发/10-基本概念/1-我的世界基础概念.html#物品信息字典#物品信息字典">物品信息字典</a> |
|
||||
| collectionName | str | 放入容器名称,对应容器json中"custom_description"字段 |
|
||||
| collectionType | str | 放入容器类型,目前仅支持netease_container和netease_ui_container |
|
||||
| collectionIndex | int | 放入容器索引 |
|
||||
| x | int | 容器方块x坐标 |
|
||||
| y | int | 容器方块y坐标 |
|
||||
| z | int | 容器方块z坐标 |
|
||||
| cancel | bool | 是否取消该操作,默认为false,事件中改为true时拒绝此次放入自定义容器的操作 |
|
||||
|
||||
- 返回值
|
||||
|
||||
无
|
||||
|
||||
- 备注
|
||||
- 该事件只有目标槽位为空或交换物品时触发,如果目标槽位有相同物品时只会触发PlayerTryAddCustomContainerItemServerEvent事件
|
||||
- PC存在shift键移动全部物品,放入同种物品时,可能会触发tryadd和tryput,请开发者注意适配
|
||||
- 容器内物品移动,合堆,分堆的操作会分多次事件触发并且顺序不定,编写逻辑时请勿依赖事件触发顺序
|
||||
- cancel取消本次操作后不会触发对应服务端事件
|
||||
|
||||
|
||||
|
||||
## PlayerTryPutCustomContainerItemServerEvent
|
||||
|
||||
<span style="display:inline;color:#ff5555">服务端</span>
|
||||
@@ -918,18 +1076,87 @@ def OnCraftItemOutputChangeServerEvent(self, args):
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| itemDict | dict | 尝试放入物品的<a href="../../../mcguide/20-玩法开发/10-基本概念/1-我的世界基础概念.html#物品信息字典#物品信息字典">物品信息字典</a> |
|
||||
| collectionName | str | 放入容器名称,目前仅支持netease_container和netease_ui_container |
|
||||
| collectionName | str | 放入容器名称,对应容器json中"custom_description"字段 |
|
||||
| collectionType | str | 放入容器类型,目前仅支持netease_container和netease_ui_container |
|
||||
| collectionIndex | int | 放入容器索引 |
|
||||
| playerId | str | 玩家id |
|
||||
| x | float | 容器方块x坐标 |
|
||||
| y | float | 容器方块y坐标 |
|
||||
| z | float | 容器方块z坐标 |
|
||||
| x | int | 容器方块x坐标 |
|
||||
| y | int | 容器方块y坐标 |
|
||||
| z | int | 容器方块z坐标 |
|
||||
| cancel | bool | 是否取消该操作,默认为false,事件中改为true时拒绝此次放入自定义容器的操作 |
|
||||
|
||||
- 返回值
|
||||
|
||||
无
|
||||
|
||||
- 备注
|
||||
- 该事件只有目标槽位为空时触发,如果目标槽位有相同物品时只会触发PlayerTryAddCustomContainerItemServerEvent事件
|
||||
- PC存在shift键移动全部物品,放入同种物品时,可能会触发tryadd和tryput,请开发者注意适配
|
||||
- 容器内物品移动,合堆,分堆的操作会分多次事件触发并且顺序不定,编写逻辑时请勿依赖事件触发顺序
|
||||
|
||||
在零件中直接声明一个同名函数,即可完成监听,详情参考<a href="../../../mcguide/20-玩法开发/14-预设玩法编程/12-深入理解零件/0-零件开发.html#零件事件">零件事件</a>
|
||||
|
||||
|
||||
## PlayerTryRemoveCustomContainerItemClientEvent
|
||||
|
||||
<span style="display:inline;color:#7575f9">客户端</span>
|
||||
|
||||
- 描述
|
||||
|
||||
玩家尝试从自定义容器中移除物品时触发该事件
|
||||
|
||||
- 参数
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| itemDict | dict | 尝试移除物品的<a href="../../../mcguide/20-玩法开发/10-基本概念/1-我的世界基础概念.html#物品信息字典#物品信息字典">物品信息字典</a> |
|
||||
| collectionName | str | 放入容器名称,对应容器json中"custom_description"字段 |
|
||||
| collectionType | str | 放入容器类型,目前仅支持netease_container和netease_ui_container |
|
||||
| collectionIndex | int | 目标容器索引 |
|
||||
| x | int | 容器方块x坐标 |
|
||||
| y | int | 容器方块y坐标 |
|
||||
| z | int | 容器方块z坐标 |
|
||||
| cancel | bool | 是否取消该操作,默认为false,事件中改为true时拒绝此次移除物品的操作 |
|
||||
|
||||
- 返回值
|
||||
|
||||
无
|
||||
|
||||
- 备注
|
||||
- 该事件在关闭容器物品自动返回背包时也会触发,此时如果取消操作物品将会被留在容器中,容器被破坏物品也不会掉落(因为实际存储于玩家身上),当再次打开netease_ui_container容器时会显示。
|
||||
- 容器内物品移动,合堆,分堆的操作会分多次事件触发并且顺序不定,编写逻辑时请勿依赖事件触发顺序
|
||||
- cancel取消本次操作后不会触发对应服务端事件
|
||||
|
||||
|
||||
|
||||
## PlayerTryRemoveCustomContainerItemServerEvent
|
||||
|
||||
<span style="display:inline;color:#ff5555">服务端</span>
|
||||
|
||||
- 描述
|
||||
|
||||
玩家尝试从自定义容器中移除物品时触发该事件
|
||||
|
||||
- 参数
|
||||
|
||||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| itemDict | dict | 尝试移除物品的<a href="../../../mcguide/20-玩法开发/10-基本概念/1-我的世界基础概念.html#物品信息字典#物品信息字典">物品信息字典</a> |
|
||||
| collectionName | str | 放入容器名称,对应容器json中"custom_description"字段 |
|
||||
| collectionType | str | 放入容器类型,目前仅支持netease_container和netease_ui_container |
|
||||
| collectionIndex | int | 目标容器索引 |
|
||||
| playerId | str | 玩家id |
|
||||
| x | int | 容器方块x坐标 |
|
||||
| y | int | 容器方块y坐标 |
|
||||
| z | int | 容器方块z坐标 |
|
||||
|
||||
- 返回值
|
||||
|
||||
无
|
||||
|
||||
- 备注
|
||||
- 容器内物品移动,合堆,分堆的操作会分多次事件触发并且顺序不定,编写逻辑时请勿依赖事件触发顺序
|
||||
|
||||
在零件中直接声明一个同名函数,即可完成监听,详情参考<a href="../../../mcguide/20-玩法开发/14-预设玩法编程/12-深入理解零件/0-零件开发.html#零件事件">零件事件</a>
|
||||
|
||||
|
||||
@@ -939,7 +1166,7 @@ def OnCraftItemOutputChangeServerEvent(self, args):
|
||||
|
||||
- 描述
|
||||
|
||||
玩家点击右键尝试使用物品时服务端抛出的事件。注:ClientItemTryUseEvent的cancel设置为True时,服务端事件不会被触发了。
|
||||
玩家点击右键尝试使用物品时服务端抛出的事件。
|
||||
|
||||
- 参数
|
||||
|
||||
@@ -954,6 +1181,7 @@ def OnCraftItemOutputChangeServerEvent(self, args):
|
||||
无
|
||||
|
||||
- 备注
|
||||
- ClientItemTryUseEvent的cancel设置为True时,服务端事件不会被触发了。
|
||||
- ServerItemTryUseEvent/ClientItemTryUseEvent不能取消对方块使用物品的行为,如使用生物蛋,使用桶倒出/收集,使用打火石点燃草等;如果想要取消这种行为,请使用ClientItemUseOnEvent和ServerItemUseOnEvent
|
||||
|
||||
在零件中直接声明一个同名函数,即可完成监听,详情参考<a href="../../../mcguide/20-玩法开发/14-预设玩法编程/12-深入理解零件/0-零件开发.html#零件事件">零件事件</a>
|
||||
@@ -965,7 +1193,7 @@ def OnCraftItemOutputChangeServerEvent(self, args):
|
||||
|
||||
- 描述
|
||||
|
||||
玩家在对方块使用物品之前服务端抛出的事件。注:客户端事件ClientItemUseOnEvent设置ret设置为True时,服务端不再会接受到这个事件。
|
||||
玩家在对方块使用物品之前服务端抛出的事件。
|
||||
|
||||
- 参数
|
||||
|
||||
@@ -990,6 +1218,7 @@ def OnCraftItemOutputChangeServerEvent(self, args):
|
||||
无
|
||||
|
||||
- 备注
|
||||
- 客户端事件ClientItemUseOnEvent设置ret设置为True时,服务端不再会接受到这个事件。
|
||||
- 当对原生方块进行使用时,如堆肥桶等类似有 使用 功能的方块使用物品时,不会触发该事件。而当原生方块加入监听后,ServerBlockUseEvent会触发。当需要获取触发时使用的物品时,可以通过item组件(例如GetPlayerItem接口)获取手中持有的物品,对应的客户端事件同理。
|
||||
|
||||
在零件中直接声明一个同名函数,即可完成监听,详情参考<a href="../../../mcguide/20-玩法开发/14-预设玩法编程/12-深入理解零件/0-零件开发.html#零件事件">零件事件</a>
|
||||
|
||||
Reference in New Issue
Block a user