用户:
。Han查看:4 回复:2 评论:4 创建时间:2022-08-03T13:17:30
如何制作沼泽陷阱,求助~
呵呵0486//如果沼泽是模型的话 首先要在沼泽模型上加入“沼泽陷阱”标签
world.onEntityContact(async({entity,other}) => {
if(other.hasTag('沼泽陷阱') && entity.isPlayer) {//判断
entity.player.kick(10)//收到10伤害
}
world.say(eval('world.querySelectorAll("player").forEach((where)=>{where.player.kick(10)})')/*查找玩家*/+'受到了10伤害')//广播消息
})
//如果沼泽是液体的话
world.onFluidEnter(({ entity, voxel})=>{
if(voxels.name(voxel)=='沼泽液体的名称' && entity.isPlayer) {//判断
entity.player.kick(10)//收到10伤害
}
world.say(eval('world.querySelectorAll("player").forEach((where)=>{where.player.kick(10)})')/*查找玩家*/+'受到了10伤害')//广播消息
})
点赞0
评论