1745 lines
51 KiB
Python
1745 lines
51 KiB
Python
# coding=utf-8
|
||
from ..ToolsConfig import clientBaseSystem, serverBaseSystem, clientCompFactory, LevelId
|
||
from ..SystemTools import SystemTools
|
||
from ..ToolsConfig import MOD_NAME, serverCompFactory, serverApi
|
||
from ..ScreenTools import ScreenTools, RegisterScreenFastly
|
||
from ..OtherTools import mounts
|
||
from ..MolangTools import molangNames
|
||
|
||
|
||
class BlueFoxClientSystem(clientBaseSystem):
|
||
SystemTool = SystemTools.GetTools('BlueFoxClientSystem')
|
||
BlueFoxServerListener = SystemTool.ListenForEvent(namespace=MOD_NAME, systemName='BlueFoxServerSystem')
|
||
|
||
def __init__(self, namespace, systemName):
|
||
super(BlueFoxClientSystem, self).__init__(namespace, systemName)
|
||
molangComp = clientCompFactory.CreateQueryVariable(LevelId)
|
||
self.blockMolangComp = clientCompFactory.CreateBlockInfo(LevelId)
|
||
if self.__class__ == BlueFoxClientSystem:
|
||
self.SystemTool.Binding(self)
|
||
for mountCls in mounts['c']:
|
||
mountCls.blueFoxSystem = self
|
||
print "{}类已挂载{}!".format(mountCls.__name__, systemName)
|
||
for molangNV in molangNames.items():
|
||
molangComp.Register(*molangNV)
|
||
print "Molang:{}已注册, 默认值:{}".format(*molangNV)
|
||
print "{}系统已注册!".format(systemName)
|
||
|
||
@BlueFoxServerListener
|
||
def ChangeBlockEntityMolang(self, args):
|
||
if args['posDim'][3] == clientCompFactory.CreateGame(LevelId).GetCurrentDimension():
|
||
self.blockMolangComp.SetBlockEntityMolangValue(
|
||
args['posDim'][:3], args['molangName'], args['value']
|
||
)
|
||
|
||
@SystemTool.ListenForEvent()
|
||
def UiInitFinished(self, args):
|
||
"""
|
||
UI引擎加载完毕时触发,本函数继承重写需要执行父类函数
|
||
"""
|
||
if self.__class__ == BlueFoxClientSystem:
|
||
for screenDef, cls in ScreenTools.autoRegister:
|
||
cls.blueFoxClient = self
|
||
RegisterScreenFastly(cls, screenDef)
|
||
print "{}界面已注册!".format(screenDef)
|
||
self.NotifyToServer('SetBlockBlockOffset', {})
|
||
|
||
def _setBlockBlockMobelOffset(self, blockPos, originalPos):
|
||
"""
|
||
方块块尝试偏移模型时触发,不建议修改
|
||
"""
|
||
offsets = [0, 0, 0]
|
||
for _ in range(3):
|
||
offsets[_] = (blockPos[_] - originalPos[_]) * -1
|
||
if not clientCompFactory.CreateBlockInfo(LevelId).SetBlockEntityModelPosOffset(
|
||
blockPos, tuple(offsets)
|
||
):
|
||
clientCompFactory.CreateGame(LevelId).AddTimer(
|
||
0.0, self._setBlockBlockMobelOffset, blockPos, originalPos
|
||
)
|
||
|
||
@BlueFoxServerListener
|
||
def SetBlockBlockMobelOffset(self, args):
|
||
"""
|
||
方块块尝试偏移模型时触发,不建议修改
|
||
"""
|
||
clientCompFactory.CreateGame(LevelId).AddTimer(
|
||
0.0, self._setBlockBlockMobelOffset, args['SetPos'][:3], args['originalPos'][:3]
|
||
)
|
||
|
||
def AddEntityClientEvent(self, args):
|
||
"""
|
||
客户端侧创建新实体时触发
|
||
"""
|
||
pass
|
||
|
||
def AddPlayerAOIClientEvent(self, args):
|
||
"""
|
||
玩家加入游戏或者其余玩家进入当前玩家视野时触发的事件,替换AddPlayerEvent
|
||
"""
|
||
pass
|
||
|
||
def AddPlayerCreatedClientEvent(self, args):
|
||
"""
|
||
玩家进入当前玩家所在的区块AOI后,玩家皮肤数据异步加载完成后触发的事件
|
||
"""
|
||
pass
|
||
|
||
def ChunkAcquireDiscardedClientEvent(self, args):
|
||
"""
|
||
触发时机:客户端区块即将被卸载时
|
||
"""
|
||
pass
|
||
|
||
def ChunkLoadedClientEvent(self, args):
|
||
"""
|
||
触发时机:客户端区块加载完成时
|
||
"""
|
||
pass
|
||
|
||
def GameRenderTickEvent(self, args):
|
||
"""
|
||
客户端渲染帧开始时触发该事件,一秒触发次数为当前的帧数
|
||
"""
|
||
pass
|
||
|
||
def LoadClientAddonScriptsAfter(self, args):
|
||
"""
|
||
客户端加载mod完成事件
|
||
"""
|
||
pass
|
||
|
||
def OnCommandOutputClientEvent(self, args):
|
||
"""
|
||
当command命令有成功消息输出时触发
|
||
"""
|
||
pass
|
||
|
||
def OnLocalPlayerStopLoading(self, args):
|
||
"""
|
||
触发时机:玩家进入存档,出生点地形加载完成时触发。该事件触发时可以进行切换维度的操作。
|
||
"""
|
||
pass
|
||
|
||
def OnScriptTickClient(self, args):
|
||
"""
|
||
客户端tick事件,1秒30次
|
||
"""
|
||
pass
|
||
|
||
def RemoveEntityClientEvent(self, args):
|
||
"""
|
||
客户端侧实体被移除时触发
|
||
"""
|
||
pass
|
||
|
||
def RemovePlayerAOIClientEvent(self, args):
|
||
"""
|
||
玩家离开当前玩家视野时触发的事件
|
||
"""
|
||
pass
|
||
|
||
def UnLoadClientAddonScriptsBefore(self, args):
|
||
"""
|
||
客户端卸载mod之前触发
|
||
"""
|
||
pass
|
||
|
||
def ApproachEntityClientEvent(self, args):
|
||
"""
|
||
玩家靠近生物时触发
|
||
"""
|
||
pass
|
||
|
||
def EntityModelChangedClientEvent(self, args):
|
||
"""
|
||
触发时机:实体模型切换时触发
|
||
"""
|
||
pass
|
||
|
||
def EntityStopRidingEvent(self, args):
|
||
"""
|
||
触发时机:当实体停止骑乘时
|
||
"""
|
||
pass
|
||
|
||
def HealthChangeClientEvent(self, args):
|
||
"""
|
||
生物生命值发生变化时触发
|
||
"""
|
||
pass
|
||
|
||
def LeaveEntityClientEvent(self, args):
|
||
"""
|
||
玩家远离生物时触发
|
||
"""
|
||
pass
|
||
|
||
def OnGroundClientEvent(self, args):
|
||
"""
|
||
实体着地事件。玩家,沙子,铁砧,掉落的物品,点燃的TNT掉落地面时触发,其余实体着地不触发。
|
||
"""
|
||
pass
|
||
|
||
def OnMobHitMobClientEvent(self, args):
|
||
"""
|
||
触发时机:通过OpenPlayerHitMobDetection打开生物碰撞检测后,当生物间(包含玩家)碰撞时触发该事件。注:客户端和服务端分别作碰撞检测,可能两个事件返回的略有差异。
|
||
"""
|
||
pass
|
||
|
||
def StartRidingClientEvent(self, args):
|
||
"""
|
||
触发时机:一个实体即将骑乘另外一个实体
|
||
"""
|
||
pass
|
||
|
||
def CameraMotionStartClientEvent(self, args):
|
||
"""
|
||
相机运动器开始事件。相机添加运动器后,运动器开始运行时触发
|
||
"""
|
||
pass
|
||
|
||
def CameraMotionStopClientEvent(self, args):
|
||
"""
|
||
相机运动器停止事件。相机添加运动器并开始运行后,运动器自动停止时触发
|
||
"""
|
||
pass
|
||
|
||
def DimensionChangeClientEvent(self, args):
|
||
"""
|
||
玩家维度改变时客户端抛出
|
||
"""
|
||
pass
|
||
|
||
def DimensionChangeFinishClientEvent(self, args):
|
||
"""
|
||
玩家维度改变完成后客户端抛出
|
||
"""
|
||
pass
|
||
|
||
def ExtinguishFireClientEvent(self, args):
|
||
"""
|
||
玩家扑灭火焰时触发。下雨,倒水等方式熄灭火焰不会触发。
|
||
"""
|
||
pass
|
||
|
||
def GameTypeChangedClientEvent(self, args):
|
||
"""
|
||
个人游戏模式发生变化时客户端触发。
|
||
"""
|
||
pass
|
||
|
||
def OnLocalPlayerActionClientEvent(self, args):
|
||
"""
|
||
玩家动作事件,当本地玩家开始/停止某些动作时触发该事件
|
||
"""
|
||
pass
|
||
|
||
def OnLocalPlayerStartJumpClientEvent(self, args):
|
||
"""
|
||
本地玩家开始跳跃时触发
|
||
"""
|
||
pass
|
||
|
||
def OnPlayerHitBlockClientEvent(self, args):
|
||
"""
|
||
触发时机:通过OpenPlayerHitBlockDetection打开方块碰撞检测后,当玩家碰撞到方块时触发该事件。玩家着地时会触发OnGroundClientEvent,而不是该事件。客户端和服务端分别作碰撞检测,可能两个事件返回的结果略有差异。
|
||
"""
|
||
pass
|
||
|
||
def PerspChangeClientEvent(self, args):
|
||
"""
|
||
视角切换时会触发的事件
|
||
"""
|
||
pass
|
||
|
||
def PlayerAttackEntityEvent(self, args):
|
||
"""
|
||
触发时机:当本地玩家攻击时触发该事件。
|
||
"""
|
||
pass
|
||
|
||
def BlockAnimateRandomTickEvent(self, args):
|
||
"""
|
||
触发时机:以摄像机为中心,随机选取周围的方块触发Tick,触发的数量取决于设备性能。只有添加了netease:block_animate_random_tick的自定义方块才会触发此事件
|
||
"""
|
||
pass
|
||
|
||
def ClientBlockUseEvent(self, args):
|
||
"""
|
||
触发时机:玩家右键点击新版自定义方块(或者通过接口AddBlockItemListenForUseEvent增加监听的MC原生游戏方块)时客户端抛出该事件(该事件tick执行,需要注意效率问题)。
|
||
"""
|
||
pass
|
||
|
||
def FallingBlockCauseDamageBeforeClientEvent(self, args):
|
||
"""
|
||
触发时机:当下落的方块开始计算砸到实体的伤害时,客户端触发该事件
|
||
"""
|
||
pass
|
||
|
||
def ModBlockEntityLoadedClientEvent(self, args):
|
||
"""
|
||
客户端自定义方块实体初始化完成时触发
|
||
"""
|
||
pass
|
||
|
||
def ModBlockEntityRemoveClientEvent(self, args):
|
||
"""
|
||
客户端自定义方块实体卸载时触发
|
||
"""
|
||
pass
|
||
|
||
def ModBlockEntityTickClientEvent(self, args):
|
||
"""
|
||
客户端自定义方块实体tick事件
|
||
"""
|
||
pass
|
||
|
||
def OnAfterFallOnBlockClientEvent(self, args):
|
||
"""
|
||
触发时机:当实体降落到方块后客户端触发,主要用于力的计算
|
||
"""
|
||
pass
|
||
|
||
def OnEntityInsideBlockClientEvent(self, args):
|
||
"""
|
||
触发时机:当实体碰撞盒所在区域有方块时,客户端持续触发
|
||
"""
|
||
pass
|
||
|
||
def OnModBlockNeteaseEffectCreatedClientEvent(self, args):
|
||
"""
|
||
自定义方块实体绑定的特效创建成功事件,在自定义方块实体中绑定的特效创建成功时触发以及使用接口CreateFrameEffectForBlockEntity或CreateParticleEffectForBlockEntity为自定义方块实体添加特效成功时触发。
|
||
"""
|
||
pass
|
||
|
||
def OnStandOnBlockClientEvent(self, args):
|
||
"""
|
||
触发时机:当实体站立到方块上时客户端持续触发
|
||
"""
|
||
pass
|
||
|
||
def PlayerTryDestroyBlockClientEvent(self, args):
|
||
"""
|
||
当玩家即将破坏方块时,客户端线程触发该事件。主要用于床,旗帜,箱子这些根据方块实体数据进行渲染的方块,一般情况下请使用ServerPlayerTryDestroyBlockEvent
|
||
"""
|
||
pass
|
||
|
||
def ShearsDestoryBlockBeforeClientEvent(self, args):
|
||
"""
|
||
触发时机:玩家手持剪刀破坏方块时,有剪刀特殊效果的方块会在客户端线程触发该事件
|
||
"""
|
||
pass
|
||
|
||
def StartDestroyBlockClientEvent(self, args):
|
||
"""
|
||
玩家开始挖方块时触发。创造模式下不触发。
|
||
"""
|
||
pass
|
||
|
||
def StepOffBlockClientEvent(self, args):
|
||
"""
|
||
触发时机:实体移动离开一个实心方块时触发
|
||
"""
|
||
pass
|
||
|
||
def StepOnBlockClientEvent(self, args):
|
||
"""
|
||
触发时机:实体刚移动至一个新实心方块时触发。
|
||
"""
|
||
pass
|
||
|
||
def ActorAcquiredItemClientEvent(self, args):
|
||
"""
|
||
触发时机:玩家获得物品时客户端抛出的事件(有些获取物品方式只会触发客户端事件,有些获取物品方式只会触发服务端事件,在使用时注意一点。)
|
||
"""
|
||
pass
|
||
|
||
def ActorUseItemClientEvent(self, args):
|
||
"""
|
||
触发时机:玩家使用物品时客户端抛出的事件(比较特殊不走该事件的例子:1)染料对有水的炼药锅使用;2)盔甲架装备盔甲);3)喝牛奶
|
||
"""
|
||
pass
|
||
|
||
def AnvilCreateResultItemAfterClientEvent(self, args):
|
||
"""
|
||
玩家点击铁砧合成得到的物品时抛出的事件。
|
||
"""
|
||
pass
|
||
|
||
def ClientItemTryUseEvent(self, args):
|
||
"""
|
||
玩家点击右键尝试使用物品时客户端抛出的事件,可以通过设置cancel为True取消使用物品。注:如果需要取消物品的使用需要同时在ClientItemTryUseEvent和ServerItemTryUseEvent中将cancel设置为True才能正确取消。
|
||
"""
|
||
pass
|
||
|
||
def ClientItemUseOnEvent(self, args):
|
||
"""
|
||
玩家在对方块使用物品时客户端抛出的事件。注:如果需要取消物品的使用需要同时在ClientItemUseOnEvent和ServerItemUseOnEvent中将ret设置为True才能正确取消。
|
||
"""
|
||
pass
|
||
|
||
def ClientShapedRecipeTriggeredEvent(self, args):
|
||
"""
|
||
玩家合成物品时触发
|
||
"""
|
||
pass
|
||
|
||
def CraftUpdateResultItemClientEvent(self, args):
|
||
"""
|
||
玩家工作台界面更新显示可合成物品时抛出的事件。
|
||
"""
|
||
pass
|
||
|
||
def GrindStoneRemovedEnchantClientEvent(self, args):
|
||
"""
|
||
玩家点击砂轮合成得到的物品时抛出的事件
|
||
"""
|
||
pass
|
||
|
||
def InventoryItemChangedClientEvent(self, args):
|
||
"""
|
||
玩家背包物品变化时客户端抛出的事件。
|
||
"""
|
||
pass
|
||
|
||
def ItemReleaseUsingClientEvent(self, args):
|
||
"""
|
||
触发时机:释放正在使用的物品
|
||
"""
|
||
pass
|
||
|
||
def OnCarriedNewItemChangedClientEvent(self, args):
|
||
"""
|
||
手持物品发生变化时,触发该事件;数量改变不会通知
|
||
"""
|
||
pass
|
||
|
||
def PlayerTryDropItemClientEvent(self, args):
|
||
"""
|
||
触发时机:玩家丢弃物品时触发
|
||
"""
|
||
pass
|
||
|
||
def StartUsingItemClientEvent(self, args):
|
||
"""
|
||
玩家使用物品(目前仅支持Bucket(奶桶)、Trident(三叉戟)、RangedWeapon(弓)、Food(食物)、Potion(药水)、Crossbow(弩))时抛出
|
||
"""
|
||
pass
|
||
|
||
def StopUsingItemClientEvent(self, args):
|
||
"""
|
||
玩家停止使用物品(目前仅支持Bucket(奶桶)、Trident(三叉戟)、RangedWeapon(弓)、Food(食物)、Potion(药水)、Crossbow(弩))时抛出
|
||
"""
|
||
pass
|
||
|
||
def AttackAnimBeginClientEvent(self, args):
|
||
"""
|
||
攻击动作开始时触发
|
||
"""
|
||
pass
|
||
|
||
def AttackAnimEndClientEvent(self, args):
|
||
"""
|
||
攻击动作结束时触发
|
||
"""
|
||
pass
|
||
|
||
def WalkAnimBeginClientEvent(self, args):
|
||
"""
|
||
走路动作开始时触发
|
||
"""
|
||
pass
|
||
|
||
def WalkAnimEndClientEvent(self, args):
|
||
"""
|
||
走路动作结束时触发
|
||
"""
|
||
pass
|
||
|
||
def AchievementButtonMovedClientEvent(self, args):
|
||
"""
|
||
触发时机:使用自定义成就系统的时,拖动成就入口结束时触发
|
||
"""
|
||
pass
|
||
|
||
def ClientChestCloseEvent(self, args):
|
||
"""
|
||
关闭箱子界面时触发,包括小箱子,合并后大箱子和末影箱(实体容器不属于方块,不会触发该事件)
|
||
"""
|
||
pass
|
||
|
||
def ClientChestOpenEvent(self, args):
|
||
"""
|
||
打开箱子界面时触发,包括小箱子,合并后大箱子和末影箱(实体容器不属于方块,不会触发该事件)
|
||
"""
|
||
pass
|
||
|
||
def ClientPlayerInventoryCloseEvent(self, args):
|
||
"""
|
||
关闭物品背包界面时触发
|
||
"""
|
||
pass
|
||
|
||
def ClientPlayerInventoryOpenEvent(self, args):
|
||
"""
|
||
打开物品背包界面时触发
|
||
"""
|
||
pass
|
||
|
||
def CloseNeteaseShopEvent(self, args):
|
||
"""
|
||
关闭商城界面时触发,包括脚本商城和Apollo插件商城
|
||
"""
|
||
pass
|
||
|
||
def GridComponentSizeChangedClientEvent(self, args):
|
||
"""
|
||
触发时机:UI grid组件里格子数目发生变化时触发
|
||
"""
|
||
pass
|
||
|
||
def HudButtonChangedClientEvent(self, args):
|
||
"""
|
||
当原生HUD按钮位置或大小发生改变时触发,例如玩家使用了自定义控件功能会触发,可在该事件中修改mod按钮的位置防止重叠
|
||
"""
|
||
pass
|
||
|
||
def OnItemSlotButtonClickedEvent(self, args):
|
||
"""
|
||
点击快捷栏、背包栏、盔甲栏、副手栏的物品槽时触发
|
||
"""
|
||
pass
|
||
|
||
def PlayerChatButtonClickClientEvent(self, args):
|
||
"""
|
||
玩家点击聊天按钮或回车键触发呼出聊天窗口时客户端抛出的事件
|
||
"""
|
||
pass
|
||
|
||
def PopScreenAfterClientEvent(self, args):
|
||
"""
|
||
screen移除触发
|
||
"""
|
||
pass
|
||
|
||
def PopScreenEvent(self, args):
|
||
"""
|
||
screen移除触发
|
||
"""
|
||
pass
|
||
|
||
def PushScreenEvent(self, args):
|
||
"""
|
||
screen创建触发
|
||
"""
|
||
pass
|
||
|
||
def ScreenSizeChangedClientEvent(self, args):
|
||
"""
|
||
改变屏幕大小时会触发的事件
|
||
"""
|
||
pass
|
||
|
||
def OnMusicStopClientEvent(self, args):
|
||
"""
|
||
音乐停止时,当玩家调用StopCustomMusic来停止自定义背景音乐时,会触发该事件
|
||
"""
|
||
pass
|
||
|
||
def PlayMusicClientEvent(self, args):
|
||
"""
|
||
播放背景音乐时触发
|
||
"""
|
||
pass
|
||
|
||
def PlaySoundClientEvent(self, args):
|
||
"""
|
||
播放场景音效或UI音效时触发
|
||
"""
|
||
pass
|
||
|
||
def ClientJumpButtonPressDownEvent(self, args):
|
||
"""
|
||
跳跃按钮按下事件,返回值设置参数只对当次按下事件起作用
|
||
"""
|
||
pass
|
||
|
||
def ClientJumpButtonReleaseEvent(self, args):
|
||
"""
|
||
跳跃按钮按下释放事件
|
||
"""
|
||
pass
|
||
|
||
def GetEntityByCoordEvent(self, args):
|
||
"""
|
||
玩家点击屏幕时触发,多个手指点在屏幕上时,只有第一个会触发。
|
||
"""
|
||
pass
|
||
|
||
def GetEntityByCoordReleaseClientEvent(self, args):
|
||
"""
|
||
玩家点击屏幕后松开时触发,多个手指点在屏幕上时,只有最后一个手指松开时触发。
|
||
"""
|
||
pass
|
||
|
||
def GyroSensorChangedClientEvent(self, args):
|
||
"""
|
||
触发时机:陀螺仪传感器姿态发生变化时
|
||
"""
|
||
pass
|
||
|
||
def HoldBeforeClientEvent(self, args):
|
||
"""
|
||
玩家长按屏幕,即将响应到游戏内时触发。仅在移动端或pc的F11模式下触发。pc的非F11模式可以监听RightClickBeforeClientEvent事件
|
||
"""
|
||
pass
|
||
|
||
def LeftClickBeforeClientEvent(self, args):
|
||
"""
|
||
玩家按下攻击/摧毁键时触发,例如鼠标左键、新触控攻击键、手柄右扳机键。鼠标左键仅在pc的普通控制模式(即非F11模式)下触发
|
||
"""
|
||
pass
|
||
|
||
def LeftClickReleaseClientEvent(self, args):
|
||
"""
|
||
玩家松开攻击/摧毁键时触发,例如鼠标左键、新触控攻击键、手柄右扳机键。鼠标左键仅在pc的普通控制模式(即非F11模式)下触发
|
||
"""
|
||
pass
|
||
|
||
def MouseWheelClientEvent(self, args):
|
||
"""
|
||
鼠标滚轮滚动时触发
|
||
"""
|
||
pass
|
||
|
||
def OnBackButtonReleaseClientEvent(self, args):
|
||
"""
|
||
返回按钮(目前特指安卓系统导航中的返回按钮)松开时触发
|
||
"""
|
||
pass
|
||
|
||
def OnClientPlayerStartMove(self, args):
|
||
"""
|
||
移动按钮按下触发事件,在按住一个方向键的同时,去按另外一个方向键,不会触发第二次
|
||
"""
|
||
pass
|
||
|
||
def OnClientPlayerStopMove(self, args):
|
||
"""
|
||
移动按钮按下释放时触发事件,同时按下多个方向键,需要释放所有的方向键才会触发事件
|
||
"""
|
||
pass
|
||
|
||
def OnGamepadControllerLayoutChangeClientEvent(self, args):
|
||
"""
|
||
游戏手柄按键映射改变事件
|
||
"""
|
||
pass
|
||
|
||
def OnGamepadKeyPressClientEvent(self, args):
|
||
"""
|
||
游戏手柄按键事件
|
||
"""
|
||
pass
|
||
|
||
def OnGamepadStickClientEvent(self, args):
|
||
"""
|
||
游戏手柄摇杆事件
|
||
"""
|
||
pass
|
||
|
||
def OnGamepadTriggerClientEvent(self, args):
|
||
"""
|
||
游戏手柄扳机事件
|
||
"""
|
||
pass
|
||
|
||
def OnKeyPressInGame(self, args):
|
||
"""
|
||
按键按下或按键释放时触发
|
||
"""
|
||
pass
|
||
|
||
def OnKeyboardControllerLayoutChangeClientEvent(self, args):
|
||
"""
|
||
键盘按键映射改变事件
|
||
"""
|
||
pass
|
||
|
||
def OnMouseMiddleDownClientEvent(self, args):
|
||
"""
|
||
鼠标按下中键时触发
|
||
"""
|
||
pass
|
||
|
||
def RightClickBeforeClientEvent(self, args):
|
||
"""
|
||
玩家按下使用物品/放置方块键时触发,例如鼠标右键、新触控交互键、手柄左扳机键
|
||
"""
|
||
pass
|
||
|
||
def RightClickReleaseClientEvent(self, args):
|
||
"""
|
||
玩家松开使用物品/放置方块键时触发,例如鼠标右键、新触控交互键、手柄左扳机键
|
||
"""
|
||
pass
|
||
|
||
def TapBeforeClientEvent(self, args):
|
||
"""
|
||
玩家点击屏幕并松手,即将响应到游戏内时触发。仅在移动端或pc的F11模式下触发。pc的非F11模式可以监听LeftClickBeforeClientEvent事件
|
||
"""
|
||
pass
|
||
|
||
def TapOrHoldReleaseClientEvent(self, args):
|
||
"""
|
||
玩家点击屏幕后松手时触发。仅在移动端或pc的F11模式下触发。pc的非F11模式可以使用LeftClickReleaseClientEvent与RightClickReleaseClientEvent事件监听鼠标松开
|
||
"""
|
||
pass
|
||
|
||
def Destroy(self):
|
||
"""
|
||
销毁系统实例时触发
|
||
"""
|
||
pass
|
||
|
||
|
||
class BlueFoxServerSystem(serverBaseSystem):
|
||
SystemTool = SystemTools.GetTools('BlueFoxServerSystem')
|
||
BlueFoxClientListener = SystemTool.ListenForEvent(namespace=MOD_NAME, systemName='BlueFoxClientSystem')
|
||
|
||
def __init__(self, namespace, systemName):
|
||
from .. import MolangTools
|
||
super(BlueFoxServerSystem, self).__init__(namespace, systemName)
|
||
if self.__class__ == BlueFoxServerSystem:
|
||
self.SystemTool.Binding(self)
|
||
MolangTools.blueFoxServerSystem = self
|
||
for mountCls in mounts['s']:
|
||
mountCls.blueFoxSystem = self
|
||
print "{}类已挂载{}!".format(mountCls.__name__, systemName)
|
||
print "{}系统已注册!".format(systemName)
|
||
|
||
self.ChangedSlot = set()
|
||
|
||
def InventoryItemChangedServerEvent(self, args):
|
||
"""
|
||
玩家背包物品变化时服务端抛出的事件
|
||
"""
|
||
pass
|
||
|
||
@BlueFoxClientListener
|
||
def SetBlockBlockOffset(self, args):
|
||
"""
|
||
客户端UI加载完成,尝试请求设置方块块模型偏移时触发,已编辑好逻辑
|
||
"""
|
||
pass
|
||
|
||
@BlueFoxClientListener
|
||
def ChangeItem(self, args):
|
||
"""
|
||
背包引擎界面尝试修改背包物品时触发
|
||
已编辑好玩家背包物品栏的处理逻辑,即slot<36
|
||
"""
|
||
pass
|
||
|
||
@BlueFoxClientListener
|
||
def SpawnItemEntity(self, args):
|
||
"""
|
||
背包引擎界面尝试关闭时,若具有跟手物品,需要生成物品实体时触发
|
||
"""
|
||
self.SpawnItemEntityByPlayer(args['__id__'], args['item'])
|
||
|
||
def SpawnItemEntityByPlayer(self, playerId, itemDict):
|
||
"""
|
||
背包引擎界面尝试关闭时,若具有跟手物品,需要生成物品实体时触发
|
||
"""
|
||
x, y, z = serverCompFactory.CreatePos(playerId).GetFootPos()
|
||
d = serverCompFactory.CreateDimension(playerId).GetEntityDimensionId()
|
||
posDim = (x, y + 1.2, z, d)
|
||
rot = serverCompFactory.CreateRot(playerId).GetRot()
|
||
dropItemEntityId = self.CreateEngineItemEntity(
|
||
itemDict, posDim[3], posDim[:3]
|
||
)
|
||
x, y, z = serverApi.GetDirFromRot(rot)
|
||
serverCompFactory.CreateActorMotion(dropItemEntityId).SetMotion((x * 0.3, y * 0.5, z * 0.3))
|
||
return dropItemEntityId
|
||
|
||
@BlueFoxClientListener
|
||
def RucksackScreenClosed(self, args):
|
||
"""
|
||
背包引擎界面尝试关闭时触发
|
||
"""
|
||
pass
|
||
|
||
def AchievementCompleteEvent(self, args):
|
||
"""
|
||
玩家完成自定义成就时触发该事件
|
||
"""
|
||
pass
|
||
|
||
def AddEntityServerEvent(self, args):
|
||
"""
|
||
服务端侧创建新实体,或实体从存档加载时触发
|
||
"""
|
||
pass
|
||
|
||
def AddServerPlayerEvent(self, args):
|
||
"""
|
||
触发时机:玩家加入时触发该事件。
|
||
"""
|
||
pass
|
||
|
||
def ChunkAcquireDiscardedServerEvent(self, args):
|
||
"""
|
||
服务端区块即将被卸载时触发
|
||
"""
|
||
pass
|
||
|
||
def ChunkGeneratedServerEvent(self, args):
|
||
"""
|
||
触发时机:区块创建完成时触发
|
||
"""
|
||
pass
|
||
|
||
def ChunkLoadedServerEvent(self, args):
|
||
"""
|
||
触发时机:服务端区块加载完成时
|
||
"""
|
||
pass
|
||
|
||
def ClientLoadAddonsFinishServerEvent(self, args):
|
||
"""
|
||
触发时机:客户端mod加载完成时,服务端触发此事件。服务器可以使用此事件,往客户端发送数据给其初始化。
|
||
"""
|
||
pass
|
||
|
||
def CommandEvent(self, args):
|
||
"""
|
||
玩家请求执行指令时触发
|
||
"""
|
||
pass
|
||
|
||
def CustomCommandTriggerServerEvent(self, args):
|
||
"""
|
||
自定义命令触发事件
|
||
"""
|
||
pass
|
||
|
||
def DelServerPlayerEvent(self, args):
|
||
"""
|
||
触发时机:删除玩家时触发该事件。
|
||
"""
|
||
pass
|
||
|
||
def EntityRemoveEvent(self, args):
|
||
"""
|
||
实体被删除时触发
|
||
"""
|
||
pass
|
||
|
||
def ExplosionServerEvent(self, args):
|
||
"""
|
||
当发生爆炸时触发。
|
||
"""
|
||
pass
|
||
|
||
def GlobalCommandServerEvent(self, args):
|
||
"""
|
||
服务端全局命令事件,包括聊天栏发送、SetCommand接口、命令方块(矿车)、行为包动画执行命令
|
||
"""
|
||
pass
|
||
|
||
def LoadServerAddonScriptsAfter(self, args):
|
||
"""
|
||
服务器加载完mod时触发
|
||
"""
|
||
pass
|
||
|
||
def NewOnEntityAreaEvent(self, args):
|
||
"""
|
||
触发时机:通过RegisterEntityAOIEvent注册过AOI事件后,当有实体进入或离开注册感应区域时触发该事件。
|
||
"""
|
||
pass
|
||
|
||
def OnCommandOutputServerEvent(self, args):
|
||
"""
|
||
Command命令执行成功事件
|
||
"""
|
||
pass
|
||
|
||
def OnContainerFillLoottableServerEvent(self, args):
|
||
"""
|
||
触发时机:随机奖励箱第一次打开根据loottable生成物品时
|
||
"""
|
||
pass
|
||
|
||
def OnLightningLevelChangeServerEvent(self, args):
|
||
"""
|
||
打雷强度发生改变
|
||
"""
|
||
pass
|
||
|
||
def OnLocalLightningLevelChangeServerEvent(self, args):
|
||
"""
|
||
独立维度天气打雷强度发生改变时触发
|
||
"""
|
||
pass
|
||
|
||
def OnLocalRainLevelChangeServerEvent(self, args):
|
||
"""
|
||
独立维度天气下雨强度发生改变时触发
|
||
"""
|
||
pass
|
||
|
||
def OnRainLevelChangeServerEvent(self, args):
|
||
"""
|
||
下雨强度发生改变
|
||
"""
|
||
pass
|
||
|
||
def OnScriptTickServer(self, args):
|
||
"""
|
||
服务器tick时触发,1秒有30个tick
|
||
"""
|
||
pass
|
||
|
||
def PlaceNeteaseLargeFeatureServerEvent(self, args):
|
||
"""
|
||
触发时机:网易版大型结构即将生成时服务端抛出该事件。
|
||
"""
|
||
pass
|
||
|
||
def PlaceNeteaseStructureFeatureEvent(self, args):
|
||
"""
|
||
触发时机:首次生成地形时,结构特征即将生成时服务端抛出该事件。
|
||
"""
|
||
pass
|
||
|
||
def PlayerIntendLeaveServerEvent(self, args):
|
||
"""
|
||
触发时机:即将删除玩家时触发该事件,此时可以通过各种API获取玩家的当前状态。
|
||
"""
|
||
pass
|
||
|
||
def PlayerJoinMessageEvent(self, args):
|
||
"""
|
||
触发时机:准备显示“xxx加入游戏”的玩家登录提示文字时服务端抛出的事件。
|
||
"""
|
||
pass
|
||
|
||
def PlayerLeftMessageServerEvent(self, args):
|
||
"""
|
||
触发时机:准备显示“xxx离开游戏”的玩家离开提示文字时服务端抛出的事件。
|
||
"""
|
||
pass
|
||
|
||
def ServerChatEvent(self, args):
|
||
"""
|
||
玩家发送聊天信息时触发
|
||
"""
|
||
pass
|
||
|
||
def ServerPostBlockPatternEvent(self, args):
|
||
"""
|
||
触发时机:用方块组合生成生物,生成生物之后触发该事件。
|
||
"""
|
||
pass
|
||
|
||
def ServerPreBlockPatternEvent(self, args):
|
||
"""
|
||
触发时机:用方块组合生成生物,在放置最后一个组成方块时触发该事件。
|
||
"""
|
||
pass
|
||
|
||
def ServerSpawnMobEvent(self, args):
|
||
"""
|
||
游戏内自动生成生物,以及使用api生成生物时触发
|
||
"""
|
||
pass
|
||
|
||
def ActorHurtServerEvent(self, args):
|
||
"""
|
||
触发时机:生物(包括玩家)受伤时触发
|
||
"""
|
||
pass
|
||
|
||
def ActuallyHurtServerEvent(self, args):
|
||
"""
|
||
实体实际受到伤害时触发,相比于DamageEvent,该伤害为经过护甲及buff计算后,实际的扣血量
|
||
"""
|
||
pass
|
||
|
||
def AddEffectServerEvent(self, args):
|
||
"""
|
||
触发时机:实体获得状态效果时
|
||
"""
|
||
pass
|
||
|
||
def ChangeSwimStateServerEvent(self, args):
|
||
"""
|
||
触发时机:实体开始或者结束游泳时
|
||
"""
|
||
pass
|
||
|
||
def DamageEvent(self, args):
|
||
"""
|
||
实体受到伤害时触发
|
||
"""
|
||
pass
|
||
|
||
def EntityChangeDimensionServerEvent(self, args):
|
||
"""
|
||
实体维度改变时服务端抛出
|
||
"""
|
||
pass
|
||
|
||
def EntityDefinitionsEventServerEvent(self, args):
|
||
"""
|
||
触发时机:生物定义json文件中设置的event触发时同时触发。生物行为变更事件
|
||
"""
|
||
pass
|
||
|
||
def EntityDieLoottableAfterServerEvent(self, args):
|
||
"""
|
||
触发时机:生物死亡掉落物品之后
|
||
"""
|
||
pass
|
||
|
||
def EntityDieLoottableServerEvent(self, args):
|
||
"""
|
||
触发时机:生物死亡掉落物品时
|
||
"""
|
||
pass
|
||
|
||
def EntityDroppedItemServerEvent(self, args):
|
||
"""
|
||
触发时机:生物扔出物品时触发
|
||
"""
|
||
pass
|
||
|
||
def EntityEffectDamageServerEvent(self, args):
|
||
"""
|
||
生物受到状态伤害/回复事件。
|
||
"""
|
||
pass
|
||
|
||
def EntityLoadScriptEvent(self, args):
|
||
"""
|
||
数据库加载实体自定义数据时触发
|
||
"""
|
||
pass
|
||
|
||
def EntityMotionStartServerEvent(self, args):
|
||
"""
|
||
实体运动器开始事件。实体(包含玩家)添加运动器后,运动器开始运行时触发
|
||
"""
|
||
pass
|
||
|
||
def EntityMotionStopServerEvent(self, args):
|
||
"""
|
||
实体运动器停止事件。实体(包含玩家)添加运动器并开始运行后,运动器自动停止时触发
|
||
"""
|
||
pass
|
||
|
||
def EntityPickupItemServerEvent(self, args):
|
||
"""
|
||
有minecraft:behavior.pickup_items行为的生物拾取物品时触发该事件,例如村民拾取面包、猪灵拾取金锭
|
||
"""
|
||
pass
|
||
|
||
def EntityStartRidingEvent(self, args):
|
||
"""
|
||
当实体骑乘上另一个实体时触发
|
||
"""
|
||
pass
|
||
|
||
def EntityStopRidingEvent(self, args):
|
||
"""
|
||
触发时机:当实体停止骑乘时
|
||
"""
|
||
pass
|
||
|
||
def EntityTickServerEvent(self, args):
|
||
"""
|
||
实体tick时触发。该事件为20帧每秒。需要使用AddEntityTickEventWhiteList添加触发该事件的实体类型白名单。
|
||
"""
|
||
pass
|
||
|
||
def HealthChangeBeforeServerEvent(self, args):
|
||
"""
|
||
生物生命值发生变化之前触发
|
||
"""
|
||
pass
|
||
|
||
def HealthChangeServerEvent(self, args):
|
||
"""
|
||
生物生命值发生变化时触发
|
||
"""
|
||
pass
|
||
|
||
def MobDieEvent(self, args):
|
||
"""
|
||
实体死亡时触发
|
||
"""
|
||
pass
|
||
|
||
def MobGriefingBlockServerEvent(self, args):
|
||
"""
|
||
环境生物改变方块时触发,触发的时机与mobgriefing游戏规则影响的行为相同
|
||
"""
|
||
pass
|
||
|
||
def OnFireHurtEvent(self, args):
|
||
"""
|
||
生物受到火焰伤害时触发
|
||
"""
|
||
pass
|
||
|
||
def OnGroundServerEvent(self, args):
|
||
"""
|
||
实体着地事件。实体,掉落的物品,点燃的TNT掉落地面时触发
|
||
"""
|
||
pass
|
||
|
||
def OnKnockBackServerEvent(self, args):
|
||
"""
|
||
实体被击退时触发
|
||
"""
|
||
pass
|
||
|
||
def OnMobHitBlockServerEvent(self, args):
|
||
"""
|
||
触发时机:通过OpenMobHitBlockDetection打开方块碰撞检测后,当生物(不包括玩家)碰撞到方块时触发该事件。
|
||
"""
|
||
pass
|
||
|
||
def OnMobHitMobServerEvent(self, args):
|
||
"""
|
||
触发时机:通过OpenPlayerHitMobDetection打开生物碰撞检测后,当生物间(包含玩家)碰撞时触发该事件。注:客户端和服务端分别作碰撞检测,可能两个事件返回的略有差异。
|
||
"""
|
||
pass
|
||
|
||
def ProjectileCritHitEvent(self, args):
|
||
"""
|
||
触发时机:当抛射物与头部碰撞时触发该事件。注:需调用OpenPlayerCritBox开启玩家爆头后才能触发。
|
||
"""
|
||
pass
|
||
|
||
def ProjectileDoHitEffectEvent(self, args):
|
||
"""
|
||
触发时机:当抛射物碰撞时触发该事件
|
||
"""
|
||
pass
|
||
|
||
def RefreshEffectServerEvent(self, args):
|
||
"""
|
||
触发时机:实体身上状态效果更新时触发,更新条件1、新增状态等级较高,更新状态等级及时间;2、新增状态等级不变,时间较长,更新状态持续时间
|
||
"""
|
||
pass
|
||
|
||
def RemoveEffectServerEvent(self, args):
|
||
"""
|
||
触发时机:实体身上状态效果被移除时
|
||
"""
|
||
pass
|
||
|
||
def SpawnProjectileServerEvent(self, args):
|
||
"""
|
||
触发时机:抛射物生成时触发
|
||
"""
|
||
pass
|
||
|
||
def StartRidingServerEvent(self, args):
|
||
"""
|
||
触发时机:一个实体即将骑乘另外一个实体
|
||
"""
|
||
pass
|
||
|
||
def WillAddEffectServerEvent(self, args):
|
||
"""
|
||
触发时机:实体即将获得状态效果前
|
||
"""
|
||
pass
|
||
|
||
def WillTeleportToServerEvent(self, args):
|
||
"""
|
||
实体即将传送或切换维度
|
||
"""
|
||
pass
|
||
|
||
def AddExpEvent(self, args):
|
||
"""
|
||
触发时机:当玩家增加经验时触发该事件。
|
||
"""
|
||
pass
|
||
|
||
def AddLevelEvent(self, args):
|
||
"""
|
||
触发时机:当玩家升级时触发该事件。
|
||
"""
|
||
pass
|
||
|
||
def ChangeLevelUpCostServerEvent(self, args):
|
||
"""
|
||
触发时机:获取玩家下一个等级升级经验时,用于重载玩家的升级经验,每个等级在重置之前都只会触发一次
|
||
"""
|
||
pass
|
||
|
||
def DimensionChangeFinishServerEvent(self, args):
|
||
"""
|
||
玩家维度改变完成后服务端抛出
|
||
"""
|
||
pass
|
||
|
||
def DimensionChangeServerEvent(self, args):
|
||
"""
|
||
玩家维度改变时服务端抛出
|
||
"""
|
||
pass
|
||
|
||
def ExtinguishFireServerEvent(self, args):
|
||
"""
|
||
玩家扑灭火焰时触发。下雨,倒水等方式熄灭火焰不会触发。
|
||
"""
|
||
pass
|
||
|
||
def GameTypeChangedServerEvent(self, args):
|
||
"""
|
||
当默认游戏模式或个人游戏模式发生变化时服务端触发,如果个人游戏模式不为默认时,修改默认游戏模式也会同时修改个人游戏模式,此时会触发两次该事件
|
||
"""
|
||
pass
|
||
|
||
def MountTamingEvent(self, args):
|
||
"""
|
||
玩家通过骑乘驯服生物后触发该事件
|
||
"""
|
||
pass
|
||
|
||
def OnPlayerActionServerEvent(self, args):
|
||
"""
|
||
玩家动作事件,当玩家开始/停止某些动作时触发该事件
|
||
"""
|
||
pass
|
||
|
||
def OnPlayerHitBlockServerEvent(self, args):
|
||
"""
|
||
触发时机:通过OpenPlayerHitBlockDetection打开方块碰撞检测后,当玩家碰撞到方块时触发该事件。监听玩家着地请使用客户端的OnGroundClientEvent。客户端和服务端分别作碰撞检测,可能两个事件返回的略有差异。
|
||
"""
|
||
pass
|
||
|
||
def PlayerAttackEntityEvent(self, args):
|
||
"""
|
||
触发时机:当玩家攻击时触发该事件。
|
||
"""
|
||
pass
|
||
|
||
def PlayerDieEvent(self, args):
|
||
"""
|
||
触发时机:当玩家死亡时触发该事件。
|
||
"""
|
||
pass
|
||
|
||
def PlayerDoInteractServerEvent(self, args):
|
||
"""
|
||
玩家与有minecraft:interact组件的生物交互时触发该事件,例如玩家手持空桶对牛挤奶、玩家手持打火石点燃苦力怕
|
||
"""
|
||
pass
|
||
|
||
def PlayerEatFoodServerEvent(self, args):
|
||
"""
|
||
触发时机:玩家吃下食物时触发
|
||
"""
|
||
pass
|
||
|
||
def PlayerFeedEntityServerEvent(self, args):
|
||
"""
|
||
玩家喂养生物时触发,例如玩家手持小麦喂养牛、玩家手持胡萝卜喂养幼年猪。
|
||
"""
|
||
pass
|
||
|
||
def PlayerHungerChangeServerEvent(self, args):
|
||
"""
|
||
玩家饥饿度变化时触发该事件
|
||
"""
|
||
pass
|
||
|
||
def PlayerHurtEvent(self, args):
|
||
"""
|
||
触发时机:当玩家受伤害前触发该事件。
|
||
"""
|
||
pass
|
||
|
||
def PlayerInteractServerEvent(self, args):
|
||
"""
|
||
触发时机:玩家可以与实体交互时。如果是鼠标控制模式,则当准心对着实体时触发。如果是触屏模式,则触发时机与屏幕下方的交互按钮显示的时机相同。玩家真正与实体发生交互的事件见PlayerDoInteractServerEvent
|
||
"""
|
||
pass
|
||
|
||
def PlayerNamedEntityServerEvent(self, args):
|
||
"""
|
||
玩家用命名牌重命名实体时触发,例如玩家手持命名牌对羊修改名字、玩家手持命名牌对盔甲架修改名字。
|
||
"""
|
||
pass
|
||
|
||
def PlayerRespawnEvent(self, args):
|
||
"""
|
||
触发时机:玩家复活时触发该事件。
|
||
"""
|
||
pass
|
||
|
||
def PlayerRespawnFinishServerEvent(self, args):
|
||
"""
|
||
触发时机:玩家复活完毕时触发
|
||
"""
|
||
pass
|
||
|
||
def PlayerSleepServerEvent(self, args):
|
||
"""
|
||
玩家使用床睡觉成功
|
||
"""
|
||
pass
|
||
|
||
def PlayerStopSleepServerEvent(self, args):
|
||
"""
|
||
玩家停止睡觉
|
||
"""
|
||
pass
|
||
|
||
def PlayerTeleportEvent(self, args):
|
||
"""
|
||
触发时机:当玩家传送时触发该事件,如:玩家使用末影珍珠或tp指令时。
|
||
"""
|
||
pass
|
||
|
||
def PlayerTrySleepServerEvent(self, args):
|
||
"""
|
||
玩家尝试使用床睡觉
|
||
"""
|
||
pass
|
||
|
||
def ServerPlayerGetExperienceOrbEvent(self, args):
|
||
"""
|
||
触发时机:玩家获取经验球时触发的事件
|
||
"""
|
||
pass
|
||
|
||
def StoreBuySuccServerEvent(self, args):
|
||
"""
|
||
触发时机:玩家游戏内购买商品时服务端抛出的事件
|
||
"""
|
||
pass
|
||
|
||
def BlockDestroyByLiquidServerEvent(self, args):
|
||
"""
|
||
触发时机:方块被水流破坏的事件
|
||
"""
|
||
pass
|
||
|
||
def BlockLiquidStateChangeAfterServerEvent(self, args):
|
||
"""
|
||
触发时机:方块转为含水或者脱离含水(流体)后触发
|
||
"""
|
||
pass
|
||
|
||
def BlockLiquidStateChangeServerEvent(self, args):
|
||
"""
|
||
触发时机:方块转为含水或者脱离含水(流体)前触发
|
||
"""
|
||
pass
|
||
|
||
def BlockNeighborChangedServerEvent(self, args):
|
||
"""
|
||
触发时机:自定义方块周围的方块发生变化时,需要配置netease:neighborchanged_sendto_script,详情请查阅《自定义农作物》文档
|
||
"""
|
||
pass
|
||
|
||
def BlockRandomTickServerEvent(self, args):
|
||
"""
|
||
触发时机:自定义方块配置netease:random_tick随机tick时
|
||
"""
|
||
pass
|
||
|
||
def BlockRemoveServerEvent(self, args):
|
||
"""
|
||
触发时机:监听该事件的方块在销毁时触发,可以通过ListenOnBlockRemoveEvent方法进行监听,或者通过json组件netease:listen_block_remove进行配置
|
||
"""
|
||
pass
|
||
|
||
def BlockSnowStateChangeAfterServerEvent(self, args):
|
||
"""
|
||
触发时机:方块转为含雪或者脱离含雪后触发
|
||
"""
|
||
pass
|
||
|
||
def BlockSnowStateChangeServerEvent(self, args):
|
||
"""
|
||
触发时机:方块转为含雪或者脱离含雪前触发
|
||
"""
|
||
pass
|
||
|
||
def BlockStrengthChangedServerEvent(self, args):
|
||
"""
|
||
触发时机:自定义机械元件方块红石信号量发生变化时触发
|
||
"""
|
||
pass
|
||
|
||
def ChestBlockTryPairWithServerEvent(self, args):
|
||
"""
|
||
触发时机:两个并排的小箱子方块准备组合为一个大箱子方块时
|
||
"""
|
||
pass
|
||
|
||
def CommandBlockContainerOpenEvent(self, args):
|
||
"""
|
||
触发时机:玩家点击命令方块,尝试打开命令方块的设置界面
|
||
"""
|
||
pass
|
||
|
||
def CommandBlockUpdateEvent(self, args):
|
||
"""
|
||
触发时机:玩家尝试修改命令方块的内置命令时
|
||
"""
|
||
pass
|
||
|
||
def DestroyBlockEvent(self, args):
|
||
"""
|
||
触发时机:当方块已经被玩家破坏时触发该事件。
|
||
"""
|
||
pass
|
||
|
||
def DirtBlockToGrassBlockServerEvent(self, args):
|
||
"""
|
||
触发时机:泥土方块变成草方块时触发
|
||
"""
|
||
pass
|
||
|
||
def EntityPlaceBlockAfterServerEvent(self, args):
|
||
"""
|
||
触发时机:当生物成功放置方块后触发
|
||
"""
|
||
pass
|
||
|
||
def FallingBlockBreakServerEvent(self, args):
|
||
"""
|
||
触发时机:当下落的方块实体被破坏时,服务端触发该事件
|
||
"""
|
||
pass
|
||
|
||
def FallingBlockCauseDamageBeforeServerEvent(self, args):
|
||
"""
|
||
触发时机:当下落的方块开始计算砸到实体的伤害时,服务端触发该事件
|
||
"""
|
||
pass
|
||
|
||
def FallingBlockReturnHeavyBlockServerEvent(self, args):
|
||
"""
|
||
触发时机:当下落的方块实体变回普通重力方块时,服务端触发该事件
|
||
"""
|
||
pass
|
||
|
||
def FarmBlockToDirtBlockServerEvent(self, args):
|
||
"""
|
||
触发时机:耕地退化为泥土时触发
|
||
"""
|
||
pass
|
||
|
||
def GrassBlockToDirtBlockServerEvent(self, args):
|
||
"""
|
||
触发时机:草方块变成泥土方块时触发
|
||
"""
|
||
pass
|
||
|
||
def HeavyBlockStartFallingServerEvent(self, args):
|
||
"""
|
||
触发时机:当重力方块变为下落的方块实体后,服务端触发该事件
|
||
"""
|
||
pass
|
||
|
||
def HopperTryPullInServerEvent(self, args):
|
||
"""
|
||
触发时机:当漏斗上方连接容器后,容器往漏斗开始输入物品时触发,事件仅触发一次
|
||
"""
|
||
pass
|
||
|
||
def HopperTryPullOutServerEvent(self, args):
|
||
"""
|
||
触发时机:当漏斗以毗邻的方式连接容器时,即从旁边连接容器时,漏斗向容器开始输出物品时触发,事件仅触发一次
|
||
"""
|
||
pass
|
||
|
||
def OnAfterFallOnBlockServerEvent(self, args):
|
||
"""
|
||
触发时机:当实体降落到方块后服务端触发,主要用于力的计算
|
||
"""
|
||
pass
|
||
|
||
def OnBeforeFallOnBlockServerEvent(self, args):
|
||
"""
|
||
触发时机:当实体刚降落到方块上时服务端触发,主要用于伤害计算
|
||
"""
|
||
pass
|
||
|
||
def OnEntityInsideBlockServerEvent(self, args):
|
||
"""
|
||
触发时机:当实体碰撞盒所在区域有方块时,服务端持续触发
|
||
"""
|
||
pass
|
||
|
||
def OnStandOnBlockServerEvent(self, args):
|
||
"""
|
||
触发时机:当实体站立到方块上时服务端持续触发
|
||
"""
|
||
pass
|
||
|
||
def PistonActionServerEvent(self, args):
|
||
"""
|
||
触发时机:活塞或者粘性活塞推送/缩回影响附近方块时
|
||
"""
|
||
pass
|
||
|
||
def ServerBlockEntityTickEvent(self, args):
|
||
"""
|
||
触发时机:自定义方块配置了netease:block_entity组件并设tick为true,方块在玩家的模拟距离(新建存档时可以设置,默认为4个区块)内,或者在tickingarea内的时候触发
|
||
"""
|
||
pass
|
||
|
||
def ServerBlockUseEvent(self, args):
|
||
"""
|
||
触发时机:玩家右键点击新版自定义方块(或者通过接口AddBlockItemListenForUseEvent增加监听的MC原生游戏方块)时服务端抛出该事件(该事件tick执行,需要注意效率问题)。
|
||
"""
|
||
pass
|
||
|
||
def ServerEntityTryPlaceBlockEvent(self, args):
|
||
"""
|
||
触发时机:当生物试图放置方块时触发该事件。
|
||
"""
|
||
pass
|
||
|
||
def ServerPlaceBlockEntityEvent(self, args):
|
||
"""
|
||
触发时机:手动放置或通过接口创建含自定义方块实体的方块时触发,此时可向该方块实体中存放数据
|
||
"""
|
||
pass
|
||
|
||
def ServerPlayerTryDestroyBlockEvent(self, args):
|
||
"""
|
||
当玩家即将破坏方块时,服务端线程触发该事件。
|
||
"""
|
||
pass
|
||
|
||
def ShearsDestoryBlockBeforeServerEvent(self, args):
|
||
"""
|
||
触发时机:玩家手持剪刀破坏方块时,有剪刀特殊效果的方块会在服务端线程触发该事件
|
||
"""
|
||
pass
|
||
|
||
def StartDestroyBlockServerEvent(self, args):
|
||
"""
|
||
玩家开始挖方块时触发。创造模式下不触发。
|
||
"""
|
||
pass
|
||
|
||
def StepOffBlockServerEvent(self, args):
|
||
"""
|
||
触发时机:实体移动离开一个实心方块时触发
|
||
"""
|
||
pass
|
||
|
||
def StepOnBlockServerEvent(self, args):
|
||
"""
|
||
触发时机:实体刚移动至一个新实心方块时触发。
|
||
"""
|
||
pass
|
||
|
||
def ActorAcquiredItemServerEvent(self, args):
|
||
"""
|
||
触发时机:玩家获得物品时服务端抛出的事件(有些获取物品方式只会触发客户端事件,有些获取物品方式只会触发服务端事件,在使用时注意一点。)
|
||
"""
|
||
pass
|
||
|
||
def ActorUseItemServerEvent(self, args):
|
||
"""
|
||
触发时机:玩家使用物品生效之前服务端抛出的事件(比较特殊不走该事件的例子:1)染料对有水的炼药锅使用;2)盔甲架装备盔甲)
|
||
"""
|
||
pass
|
||
|
||
def ContainerItemChangedServerEvent(self, args):
|
||
"""
|
||
容器物品变化事件
|
||
"""
|
||
pass
|
||
|
||
def CraftItemOutputChangeServerEvent(self, args):
|
||
"""
|
||
玩家从容器拿出生成物品时触发
|
||
"""
|
||
pass
|
||
|
||
def FurnaceBurnFinishedServerEvent(self, args):
|
||
"""
|
||
服务端熔炉烧制触发事件。熔炉, 高炉,烟熏炉烧出物品时触发
|
||
"""
|
||
pass
|
||
|
||
def ItemDurabilityChangedServerEvent(self, args):
|
||
"""
|
||
物品耐久度变化事件
|
||
"""
|
||
pass
|
||
|
||
def ItemReleaseUsingServerEvent(self, args):
|
||
"""
|
||
触发时机:释放正在使用的物品时
|
||
"""
|
||
pass
|
||
|
||
def ItemUseAfterServerEvent(self, args):
|
||
"""
|
||
玩家在使用物品之后服务端抛出的事件。
|
||
"""
|
||
pass
|
||
|
||
def ItemUseOnAfterServerEvent(self, args):
|
||
"""
|
||
玩家在对方块使用物品之后服务端抛出的事件。
|
||
"""
|
||
pass
|
||
|
||
def OnCarriedNewItemChangedServerEvent(self, args):
|
||
"""
|
||
触发时机:玩家切换主手物品时触发该事件
|
||
"""
|
||
pass
|
||
|
||
def OnItemPutInEnchantingModelServerEvent(self, args):
|
||
"""
|
||
触发时机:玩家将可附魔物品放到附魔台上时
|
||
"""
|
||
pass
|
||
|
||
def OnNewArmorExchangeServerEvent(self, args):
|
||
"""
|
||
触发时机:玩家切换盔甲时触发该事件
|
||
"""
|
||
pass
|
||
|
||
def OnOffhandItemChangedServerEvent(self, args):
|
||
"""
|
||
触发时机:玩家切换副手物品时触发该事件
|
||
"""
|
||
pass
|
||
|
||
def OnPlayerActiveShieldServerEvent(self, args):
|
||
"""
|
||
触发时机:玩家激活/取消激活盾牌触发的事件。包括玩家持盾进入潜行状态,以及在潜行状态切换盾牌(切换耐久度不同的相同盾牌不会触发)
|
||
"""
|
||
pass
|
||
|
||
def OnPlayerBlockedByShieldAfterServerEvent(self, args):
|
||
"""
|
||
触发时机:玩家使用盾牌抵挡伤害之后触发
|
||
"""
|
||
pass
|
||
|
||
def OnPlayerBlockedByShieldBeforeServerEvent(self, args):
|
||
"""
|
||
触发时机:玩家使用盾牌抵挡伤害之前触发
|
||
"""
|
||
pass
|
||
|
||
def PlayerDropItemServerEvent(self, args):
|
||
"""
|
||
触发时机:玩家丢弃物品时触发
|
||
"""
|
||
pass
|
||
|
||
def PlayerPickupArrowServerEvent(self, args):
|
||
"""
|
||
玩家即将捡起抛射物时触发,包括使用"netease:pick_up"的自定义抛射物
|
||
"""
|
||
pass
|
||
|
||
def ServerItemTryUseEvent(self, args):
|
||
"""
|
||
玩家点击右键尝试使用物品时服务端抛出的事件。注:如果需要取消物品的使用需要同时在ClientItemTryUseEvent和ServerItemTryUseEvent中将cancel设置为True才能正确取消。
|
||
"""
|
||
pass
|
||
|
||
def ServerItemUseOnEvent(self, args):
|
||
"""
|
||
玩家在对方块使用物品之前服务端抛出的事件。注:如果需要取消物品的使用需要同时在ClientItemUseOnEvent和ServerItemUseOnEvent中将ret设置为True才能正确取消。
|
||
"""
|
||
pass
|
||
|
||
def ServerPlayerTryTouchEvent(self, args):
|
||
"""
|
||
玩家即将捡起物品时触发
|
||
"""
|
||
pass
|
||
|
||
def ShearsUseToBlockBeforeServerEvent(self, args):
|
||
"""
|
||
触发时机:实体手持剪刀对方块使用时,有剪刀特殊效果的方块会在服务端线程触发该事件
|
||
"""
|
||
pass
|
||
|
||
def UIContainerItemChangedServerEvent(self, args):
|
||
"""
|
||
合成容器物品发生变化时触发
|
||
"""
|
||
pass
|
||
|
||
def AttackAnimBeginServerEvent(self, args):
|
||
"""
|
||
当攻击动作开始时触发
|
||
"""
|
||
pass
|
||
|
||
def AttackAnimEndServerEvent(self, args):
|
||
"""
|
||
当攻击动作结束时触发
|
||
"""
|
||
pass
|
||
|
||
def JumpAnimBeginServerEvent(self, args):
|
||
"""
|
||
当跳跃动作开始时触发
|
||
"""
|
||
pass
|
||
|
||
def WalkAnimBeginServerEvent(self, args):
|
||
"""
|
||
当走路动作开始时触发
|
||
"""
|
||
pass
|
||
|
||
def WalkAnimEndServerEvent(self, args):
|
||
"""
|
||
当走路动作结束时触发
|
||
"""
|
||
pass
|
||
|
||
def PlayerInventoryOpenScriptServerEvent(self, args):
|
||
"""
|
||
某个客户端打开物品背包界面时触发
|
||
"""
|
||
pass
|
||
|
||
def UrgeShipEvent(self, args):
|
||
"""
|
||
玩家点击商城催促发货按钮时触发该事件
|
||
"""
|
||
pass
|
||
|
||
def lobbyGoodBuySucServerEvent(self, args):
|
||
"""
|
||
玩家登录联机大厅服务器,或者联机大厅游戏内购买商品时触发。如果是玩家登录,触发时玩家客户端已经触发了UiInitFinished事件
|
||
"""
|
||
pass
|
||
|
||
def Destroy(self):
|
||
"""
|
||
销毁系统实例时触发
|
||
"""
|
||
pass
|