Ловушки ModPE - важная часть ModPE API, позволяющая отлавливать основные события в игре.
Содержание
- 1 function attackHook(attacker, victim)
- 2 function chatHook(str)
- 3 function continueDestroyBlock(x, y, z, side, progress)
- 4 function destroyBlock(x, y, z, side)
- 5 function projectileHitEntityHook(projectile, targetEntity)
- 6 function eatHook(hearts, saturationRatio)
- 7 function entityAddedHook(entity)
- 8 function entityHurtHook(attacker, victim, halfhearts)
- 9 function entityRemovedHook(entity)
- 10 function explodeHook(entity, x, y, z, power, onFire)
- 11 function serverMessageReceiveHook(str)
- 12 function deathHook(attacker, victim)
- 13 function playerAddExpHook(player, experienceAdded)
- 14 function playerExpLevelChangeHook(player, levelsAdded)
- 15 function redstoneUpdateHook(x, y, z, newCurrent, someBooleanIDontKnow, blockId, blockData)
- 16 function screenChangeHook(screenName)
- 17 function newLevel()
- 18 function startDestroyBlock(x, y, z, side)
- 19 function projectileHitBlockHook(projectile, blockX, blockY, blockZ, side)
- 20 function modTick() function useItem(x, y, z, itemid, blockid, side, itemDamage, blockDamage)
function attackHook(attacker, victim)
Можно юзать preventDefault()
function chatHook(str)
Можно юзать preventDefault()
function continueDestroyBlock(x, y, z, side, progress)
Можно юзать preventDefault()
function destroyBlock(x, y, z, side)
Можно юзать preventDefault()
function projectileHitEntityHook(projectile, targetEntity)
function eatHook(hearts, saturationRatio)
function entityAddedHook(entity)
function entityHurtHook(attacker, victim, halfhearts)
function entityRemovedHook(entity)
function explodeHook(entity, x, y, z, power, onFire)
Можно юзать preventDefault()
function serverMessageReceiveHook(str)
Можно юзать preventDefault()
function deathHook(attacker, victim)
Можно юзать preventDefault()
function playerAddExpHook(player, experienceAdded)
Можно юзать preventDefault()
function playerExpLevelChangeHook(player, levelsAdded)
Можно юзать preventDefault()
function redstoneUpdateHook(x, y, z, newCurrent, someBooleanIDontKnow, blockId, blockData)
function screenChangeHook(screenName)
function newLevel()
function startDestroyBlock(x, y, z, side)
Можно юзать preventDefault()
function projectileHitBlockHook(projectile, blockX, blockY, blockZ, side)
function modTick()
function useItem(x, y, z, itemid, blockid, side, itemDamage, blockDamage)
Можно юзать preventDefault()