用户:
安静的疾风雀军医副大队长查看:1 回复:5 评论:1 创建时间:2020-04-30T11:54:44
求各位大佬一件事,能不能给我能喵的代码?急需
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();
});点赞0
评论