Jump to content

[1.9.4] Checking What Direction A Block is Facing


Legoboy0109

Recommended Posts

I am making a block integrated with the RF api, but I want to make it so it can only connect from a certain side, but since it is a block with the directional blockstate, I need to check what direction it's facing before setting the side it can connect from. If I try to reference the FACING variable it says incompatible operand types. How would I do this?

 

Thanks,

Legoboy0109

Edited by Legoboy0109

If you're going to be salty, just take a listen.

 

Link to comment
Share on other sites

First you need to get the IBlockState at the current position, this will usually be supplied as an argument. If it's not, you'll usually have a World/IBlockAccess and a BlockPos to get it from. If you don't, you probably don't have access to the state or the value of the FACING property.

 

Then you can get the value of the FACING property using IBlockState#getValue.

 

You may find it helpful to read this introduction to block states.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

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.