This commit is contained in:
boybook
2025-12-01 20:59:16 +08:00
parent 12738a142c
commit 760c2dd9ad
5535 changed files with 21070 additions and 2021 deletions

View File

@@ -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>