用户:
我是一位小萌新查看:5 回复:7 评论:5 创建时间:2022-07-27T11:32:32
如题,需要代码...........
world.onClick(({ entity, clicker, distance }) => {
if (distance>5){//判断距离是否大于5(5可以改成任何数)
return;
}
if (entity.isPlayer) {
world.say(`${clicker.player.name} 击中 ${entity.player.name}`)
} else {
world.say(distance)
world.say(`${clicker.player.name} 击中 ${entity.id}`)
}
entity.hurt(20)
if(entity.hp<=0){
world.say(`${entity.id} 被 ${clicker.player.name}送去见喵`)
entity.destroy()
}
点赞0
评论