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

onHitEntity

打击实体时检测

判断条件: 打击实体时 检测时间: 打击实体后

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

itemstack.setItem("minecraft:deadbush")
//设置物品为枯死的灌木
living.attack(100)
//给实体造成100点伤害
player.sendMessage("干碎!")
//说句话
world.createExplosion(player.getPosX(), player.getPosY(), player.getPosZ(), 1.0, false)
//生成一次爆炸 (4.0为TNT当量)
上一页onEaten下一页onLeftClickLiving

最后更新于4年前

这有帮助吗?