#getBlockFromViewDirection() function does not work under liquid
1 messages · Page 1 of 1 (latest)
.......
const callBase = player.getBlockFromViewDirection({includeLiquidBlocks:true,includePassableBlocks:false,maxDistance:32})
if(typeof callBase !== "undefined"){
console.warn(JSON.stringify({
location: callBase.location,
maxDistance: Math.min(6,3*(system.currentTick-queue.playerCallingTick[player.id].tick)/10 + 1),
closest: 1,
families: ['pikmin'],
tags: ['pikmin:move'],
excludeTags: ['pikmin:hasOwner','pikmin:called']
}))
console.warn(callBase.typeId)
}
What version of the game do you use?
1.19.83
oh preview
sorry, i didnt notice that tag
dang, sure is a bug
remove includePassableBlocks
It seems that the error is in includeLiquidBlocks, since if this has a true or false value the bug occurs
const callBase = player.getBlockFromViewDirection({ includeLiquidBlocks: true, maxDistance: 32 })
if (!callBase.isSolid()) return
it's weird how it's not getting water when ur on surface
actually it gets water
with this code
actually idk
const callBase = player.getBlockFromViewDirection({includePassableBlocks:false,maxDistance:32})
if(typeof callBase !== "undefined"){
console.warn(callBase.typeId)
}
Now this code is working for me
its prob the "include" options that's bugging themselves that defaults to 0 0 0 when it's confused
includeLiquidBlocks generates problems I think
the includePassableBlocks does not seem to give any problem
thats gud then