- 致编者:请牢记我们的域名wiki.mcbe-dev.net!
- 致编者:欢迎加入本Wiki的官方交流QQ群或Discord服务器!
- 基岩版1.19.31现已发布!(了解更多)
- Inner Core现已支持Xbox模组联机!(了解更多)
- 如果您是第一次来到本Wiki,欢迎注册一个账户
- 点击顶部的“编辑”或“编辑源代码”按钮即可编辑当前页面
- 请知悉:在不登录时也可以编辑和新建页面,但是您当前的IP地址会记录在编辑历史中
手册:levelEventHook
来自Minecraft基岩版开发Wiki
levelEventHook
Function
钩子函数
钩子函数
参数类型
参数 1
Number:int
参数 2
Number:int
参数 3
Number:int
参数 4
Number:int
参数 5
Number:int
参数 6
Number:int
返回值类型
void
API
适用语言
levelEventHook是ModPE Script的一个钩子函数,当存档事件触发时会被调用。
语法
function levelEventHook(player, eventType, x, y, z, data){}
参数
- 参数一
player
- int类型,广播该存档事件的客户端对应的玩家的UUID。
- 参数二
eventType
- int类型,事件类型的数字ID。
- 参数三
x
- int类型,该存档事件发生的X坐标。
- 参数四
y
- int类型,该存档事件发生的Y坐标。
- 参数五
z
- int类型,该存档事件发生的Z坐标。
- 参数六
data
- int类型,该存档事件的数据值。
上下文
一个存档事件被游戏的存档事件广播器广播。
存档事件列表
枚举键 | 值 | 描述 |
---|---|---|
Undefined | 0 | |
SoundClick | 1000 | |
SoundClickFail | 1001 | |
SoundLaunch | 1002 | |
SoundOpenDoor | 1003 | |
SoundFizz | 1004 | |
SoundFuse | 1005 | |
SoundPlayRecording | 1006 | |
SoundGhastWarning | 1007 | |
SoundGhastFireball | 1008 | |
SoundBlazeFireball | 1009 | |
SoundZombieWoodenDoor | 1010 | |
SoundZombieDoorCrash | 1012 | |
SoundZombieInfected | 1016 | |
SoundZombieConverted | 1017 | |
SoundEndermanTeleport | 1018 | |
SoundAnvilBroken | 1020 | |
SoundAnvilUsed | 1021 | |
SoundAnvilLand | 1022 | |
SoundInfinityArrowPickup | 1030 | |
SoundTeleportEnderPearl | 1032 | |
SoundAddItem | 1040 | |
SoundItemFrameBreak | 1041 | |
SoundItemFramePlace | 1042 | |
SoundItemFrameRemoveItem | 1043 | |
SoundItemFrameRotateItem | 1044 | |
SoundExperienceOrbPickup | 1051 | |
SoundTotemUsed | 1052 | |
SoundArmorStandBreak | 1060 | |
SoundArmorStandHit | 1061 | |
SoundArmorStandLand | 1062 | |
SoundArmorStandPlace | 1063 | |
ParticlesShoot | 2000 | |
ParticlesDestroyBlock | 2001 | |
ParticlesPotionSplash | 2002 | |
ParticlesEyeOfEnderDeath | 2003 | |
ParticlesMobBlockSpawn | 2004 | |
ParticleCropGrowth | 2005 | |
ParticleSoundGuardianGhost | 2006 | |
ParticleDeathSmoke | 2007 | |
ParticleDenyBlock | 2008 | |
ParticleGenericSpawn | 2009 | |
ParticlesDragonEgg | 2010 | |
ParticlesCropEaten | 2011 | |
ParticlesCrit | 2012 | |
ParticlesTeleport | 2013 | |
ParticlesCrackBlock | 2014 | |
ParticlesBubble | 2015 | |
ParticlesEvaporate | 2016 | |
ParticlesDestroyArmorStand | 2017 | |
ParticlesBreakingEgg | 2018 | |
ParticleDestroyEgg | 2019 | |
ParticlesEvaporateWater | 2020 | |
ParticlesDestroyBlockNoSound | 2021 | |
ParticlesKnockbackRoar | 2022 | |
ParticlesTeleportTrail | 2023 | |
ParticlesPointCloud | 2024 | |
ParticlesExplosion | 2025 | |
ParticlesBlockExplosion | 2026 | |
StartRaining | 3001 | |
StartThunderstorm | 3002 | |
StopRaining | 3003 | |
StopThunderstorm | 3004 | |
GlobalPause | 3005 | |
SimTimeStep | 3006 | |
SimTimeScale | 3007 | |
ActivateBlock | 3500 | |
CauldronExplode | 3501 | |
CauldronDyeArmor | 3502 | |
CauldronCleanArmor | 3503 | |
CauldronFillPotion | 3504 | |
CauldronTakePotion | 3505 | |
CauldronFillWater | 3506 | |
CauldronTakeWater | 3507 | |
CauldronAddDye | 3508 | |
CauldronCleanBanner | 3509 | |
CauldronFlush | 3510 | |
AgentSpawnEffect | 3511 | |
CauldronFillLava | 3512 | |
CauldronTakeLava | 3513 | |
StartBlockCracking | 3600 | |
StopBlockCracking | 3601 | |
UpdateBlockCracking | 3602 | |
AllPlayersSleeping | 9800 | |
JumpPrevented | 9810 | |
ParticleLegacyEvent | 16384 |
历史
BlockLauncher | |||||
---|---|---|---|---|---|
? | 加入了levelEventHook(entity, eventType, x, y, z, data) 。 | ||||
? | 参数表中的entity 改名为player 。 | ||||
? | 将该函数从ModPE Script的函数转储中隐去。 |