Jump to content

Possible to add mult hardness lvls to one block id or make block indestructible?


happyPenguin

Recommended Posts

Hey guys I'm just wondering if it was possible to set two block ids for one block or make the block indestructible once the block has been activated.

 

For example when my block is placed on the ground I want it to be able to be broken but once its been activated the block generates a structure and is placed at the top of the structure and made indestructible so the player can't cheat and make multiple structures using one block.

Link to comment
Share on other sites

Hey guys I'm just wondering if it was possible to set two block ids for one block or make the block indestructible once the block has been activated.

 

For example when my block is placed on the ground I want it to be able to be broken but once its been activated the block generates a structure and is placed at the top of the structure and made indestructible so the player can't cheat and make multiple structures using one block.

Different metadata can have different hardness, so just change the metadata.

Link to comment
Share on other sites

Note that setting hardness level to -1 renders the block indestructible.

 

OR

 

Use function provided by Forge Block.setBlockUnbreakable() (which does exactly the same as the first option but looks and reads nicer.

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.