Jump to content

Detect blocks placed by players


mailmindlin

Recommended Posts

Hi

 

>How does minecraft do it (leaf blocks)?

Not sure what you mean?  Leaf blocks don't overwrite existing blocks, only empty space.

 

If you just want your autobuild to overwrite air only, it's easy.  Get the block using world.getBlock, check block.isAirBlock(x,y,z), and only overwrite if it's air.

 

If you want your autobuild to overwrite (eg) naturally generated stone, but not stone placed by a player, then that is possible but very complicated (and almost certainly not worth the trouble)

 

-TGG

 

Link to comment
Share on other sites

I am not sure what leaves do to differentiate between having been placed by a player, and having been spawned by a tree, but it seems like something akin to using a single bit of metadata - the third least significant bit, in this case.

 

While you can of course not use this for blocks that have directions, etc., perhaps this can be of use when determining whether, say, dirt or stone was placed by a player.

 

There would be several ways to go about this, I presume - but relying on metadata in blocks that don't expect metadata is just asking for trouble.

Link to comment
Share on other sites

If you mean leaves disappear when placed by a player when you say what you said, then try sticking a wood block next to those leaves.

 

If that isn't what you meant... * shrugs * learn how to use ASM and add a flag to blocks as to whether or not they were placed by a player. As TGG said, a lot of hassle and not really worth it.

We all stuff up sometimes... But I seem to be at the bottom of that pot.

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.