Jump to content

[1.7.10] Need to check if a block exists above the player


momnop

Recommended Posts

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.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.