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

onUpdate

实时检测

判断条件: 在玩家身上时 检测时间: 每Tick

函数效果:当在玩家身上时可使用 isCurrentItem || itemstack || player || slotId || world 类方法

player.sendMessage(isCurrentItem)
//当你手持此物时返回结果 (布尔值)
itemstack.setIntData("Value", itemstack.getIntData("Value") + 1)
//创建一个Int数据
player.setHealth(player.getHealth() + (player.getMaxHealth() - player.getHealth()))
//保持你的决心 (设置生命值为生命上限)
player.sendMessage(slotId)
//当前物品在你背包的哪个槽位
world.setTime(world.getTime() + 1)
//Made In Heaven! (世界时间 + 1tick|划掉#命不要辣)
上一页onStoppedUsing下一页onUse

最后更新于4年前

这有帮助吗?