MrDiamondDog Posted June 2, 2023 Share Posted June 2, 2023 (edited) I need to check if a block can be passed through, such as any liquid, grass, or vines. Edited June 2, 2023 by MrDiamondDog solved Quote Link to comment Share on other sites More sharing options...
ChampionAsh5357 Posted June 2, 2023 Share Posted June 2, 2023 You can check whether BlockState#getCollisionShape has an empty VoxelShape. 1 Quote Link to comment Share on other sites More sharing options...
MrDiamondDog Posted June 2, 2023 Author Share Posted June 2, 2023 This works, thank you! Quote Link to comment Share on other sites More sharing options...
MFMods Posted June 5, 2023 Share Posted June 5, 2023 if you when to check whether blocks are completely "empty" (in terms of collision), that's that. maybe you want to allow for blocks that are mostly empty (various rails or ladders). getCollisionShape, as Ash said, gives you blocks shape. multiply xSize * ySize * zSize and you get the volume. if you compare that to (for example) 13% of the full block, rails and pressure plates will pass but slabs will not. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.