Jump to content

Get block facing(north,south,west or east) and copy it to another block


Recommended Posts

Posted

block state has getValue and setValue methods. use them to make a new state and then call world.setBlock.

but why do you have two blocks? if it's not more complicated than what you described, you have a block similar to crop or a berry bush. it can be the same block with one more state property. then, when your item is "harvested" from a block, you'd just say world.setBlock(state.setValue(AGE, 0)) and you don't worry about the rotation - it just stays the same.

Posted

you would have one property that controls rotation and one that controls texture (and right-click behavior).

look into AbstractFurnaceBlock. it has one property for direction and one for functionality. (you may want to extend HorizontalBlock).
look at furnace blockstate json and furnace model json.

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.