Lv.1
在 碰到模型玩家喵的代码是什么 中回复
world.onEntityContact(({entity,other})=>{ if(other.id == '模型名' && entity.isPlayer){ entity.hurt(100) } })
2023-01-15T21:04:44 点赞:0
在 【代码求助】如何实现摔落伤害? 中回复
world.onPlayerJoin(({entity})=>{ entity.enableDamage = true }); world.onFluidEnter(async({entity,voxel})=>{ if(!entity.isPlayer){return;} entity.player.fall=0 }); world.onFluidLeave(async({entity,voxel})=>{ if(!entity.isPlayer){return;} entity.player.fall=0 }); world.onVoxelContact(async({entity,x,y,z,voxel})=>{ if (!entity.isPlayer) return; let i=entity.player.fall-y; if(entity.player.fall-y>20){; entity.hurt(i/5) entity.player.directMessage('你受到了'+i/5+'点摔落伤害') }; entity.player.fall=y; }); world.onPlayerJoin(({entity})=>{ entity.player.fall=0 }); world.onDie(async({entity})=>{ entity.player.fall=0 });
2023-01-17T12:58:18 点赞:0
在 亿些疑问,大佬回答一下 中回复
1.你写就行了2.用while代码写就行了3.你自己看就行了https://shequ.codemao.cn/community/521633
2023-01-24T17:34:03 点赞:0