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. 物品类函数

onLeftClickLiving

左击实体时检测

判断条件: 左击实体时 检测时间: 左击实体前

函数效果:当左击实体时可使用 itemstack || living || player || world 类方法

itemstack.addEnchantment(1,2)
//附魔 火焰保护 II
player.sendMessage(living.getHealth())
//获取实体生命值
player.swingItem()
//挥动一次物品
world.spawnMob(player.getPosX(), player.getPosY(), player.getPosZ(), "Chicken")
//生成一只鸡
上一页onHitEntity下一页onLeftClickPlayer

最后更新于4年前

这有帮助吗?