猫史档案馆


BCMOJANG

BCMOJANG

Lv.1

今生无悔入mc,来世愿做方块人!

获赞:52收藏:1浏览:501作品收藏:4
回复帖子评论
上一页1 页 / 共 1下一页

【社区功能反馈】用心倾听,用头发发电!(2026更新版) 中回复

为什么最喵台总是崩溃????

2022-09-07T21:24:43 点赞:0

【求助】谁会攻击距离为8格的PVP代码 中回复

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()
        
     }
    

2022-12-26T15:35:16 点赞:0

请教问题-距离判定 中回复

world.onClick(({ entity, clicker, distance }) => { 
    if (distance>10){//判断距离是否大于10(10可以改成任何数)
         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}KO了!`)
         entity.destroy()
        
     }
    

2022-12-26T15:36:50 点赞:0

请教问题-距离判定 中回复

很简单

2022-12-26T15:37:08 点赞:0

求助,怎么点击玩家之后如果他跟点击者的距离小于50,才能进行伤害 中回复

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()
        
     }
    

2022-12-26T15:38:10 点赞:0