猫史档案馆


喵000000000000000000000000000000000000000

用户:钢铁侠mark85钢铁侠mark85查看:4 回复:3 评论:4 创建时间:2020-05-19T17:40:42


 

//一个简单的射击PvP
  world.onPlayerJoin(({ entity }) => {
    entity.enableDamage = true;
    entity.player.onPress(({ button, raycast:{ hitEntity, direction } }) => {
        if (button !== 'action0' || !hitEntity) {
            return;
        }
        hitEntity.velocity.x += direction.x;
        hitEntity.velocity.y += 0.5;
        hitEntity.velocity.z += direction.z;
        hitEntity.hurt(20 * Math.random() + 5, {
            attacker: entity,
        });
    });
});

world.onDie(({ entity, attacker }) => {
    if (attacker) {
        world.say(attacker.player.name + ' killed ' + entity.player.name)
    }
    entity.player.forceRespawn();
});

 


回复

上一页1 页 / 共 1下一页
一块软糖一块软糖

链接:https://pan.baidu.com/s/1g4TF5R2mhQy09XDMPnRvCQ
提取码:4apw

点赞0


评论


一块软糖一块软糖

大佬做的我的世界

点赞0


评论


LAG的逮虾户LAG的逮虾户

你好

点赞0


评论