用户:
一个STUB用户_6715468查看:0 回复:3 评论:0 创建时间:2021-02-20T19:42:45
代码:
world.onVoxelContact(({entity,axis,x,y,z}) => {
if(entity.isPlayer){
if(axis.y < 1 && axis.y > -1){
if(voxels.getVoxelId(x,y+1,z) == voxels.id('air')){
entity.velocity.y = 0.75;
}
}
}
});
使用该代码,可以实现自动跳跃一格的效果
有点水,大佬勿喷