Skip to content

[Bug]: pl.getBlockFromViewVector()函数无法正确获取玩家目视方块 #214

@Wankeup

Description

@Wankeup

Describe the bug

使用pl.getBlockFromViewVector()函数获取目视方块时,无论传入的检测距离是多少,无论朝向什么方向,什么方块,以即无论是否在检测距离内有方块,均返回在坐标(0,0,0)的方块

To Reproduce

//使用玩家到实体的距离是为了实时改变输入获取目视方块检测距离
let X = pl.distanceTo(en)
//后续也做过测试,此处X使用Math.ceil()取整后也是一样的结果
let bl = pl.getBlockFromViewVector(false,false,X,true)
if (bl) {
pl.tell(当前玩家坐标${pl.pos},检测距离${X},有方块,方块坐标${bl.pos}:${bl.name})
return
}else{
pl.tell(和实体之间无方块)
return
}

Expected behavior

正确获取玩家目视方块

Screenshots

以下图片均以视线中心羊到玩家所在的距离传入上述代码中的X
Image
Image
Image
Image

Platform

No response

BDS Version

No response

LeviLamina Version

No response

LegacyScriptEngine Version

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions