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

onUseOnEntity

右击实体时

判断条件: 右击实体时 检测时间: 单击右键时

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

itemstack.setStringData("entityName", living.getName())
//创建一个String数据
player.sendMessage(living.getName())
//说句话
world.sendMessageToPlayer(player.getUsername(), living.getName())
//说句话
上一页onUseFirst下一页onUseOnPlayer

最后更新于4年前

这有帮助吗?