Posted September 20, 201510 yr Hello everyone. I'm trying to figure out how I can check if a block exists in any given distance above the player and if so, return a boolean displaying if one exists or not. If anybody could help that'd be great. Thanks!
September 20, 201510 yr If you need to do this in a method where you already have the player entity and the world as parameters, it is rather easy. I forget the exact method called (away from IDE), but if your IDE has a code suggestion feature check the world object for a method that contains the word 'sky'. There should be a method that checks whether a certain object can see the sky based on blocks above it. Put in the coordinates of your player, and this should tell you whether there is anything above it. If anyone has a comprehensive, visual guide to GUIs - don't hesitate to message me. They make my head spin.
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.