CS3 中文Wiki
  • Custom Stuff 3
  • 事件函数
  • 物品类函数
    • onArmorUpdate
    • onBlockDestroyed
    • onBlockStartBreak
    • onCreated
    • onDroppedByPlayer
    • onEaten
    • onHitEntity
    • onLeftClickLiving
    • onLeftClickPlayer
    • onRightClick
    • onStoppedUsing
    • onUpdate
    • onUse
    • onUseFirst
    • onUseOnEntity
    • onUseOnPlayer
    • onUsing
  • Untitled
  • 方块类函数
由 GitBook 提供支持
在本页

这有帮助吗?

  1. 物品类函数

onBlockStartBreak

方块破坏前检测

判断条件: 破坏方块时 检测时间: 破坏方块前

函数效果:当破坏方块时可使用 itemstack || player || position || world 类方法

itemstack.addEnchantment(1,1)
//附魔 火焰保护 I
player.sendChat("/me is so Good")
//以玩家身份执行命令
player.sendMessage(position.x + " " + position.y + " " + position.z)
//获取方块被破坏时的坐标 (z轴会偏移1~2格#大概是取整问题)
player.sendMessage(world.getTime())
//获取当前时间 (以tick为单位 获取游戏tick总和)
上一页onBlockDestroyed下一页onCreated

最后更新于4年前

这有帮助吗?