Jump to content

Metadata sub-blocks with different classes?


Meoco

Recommended Posts

Simple question that I haven't been able to find a good answer to: Can I make a block ID with each metadata value referencing a different class?

 

i.e. A block that, when powered, will switch to another block with specific logic and emits redstone.

 

Or am I going about this wrong?

Link to comment
Share on other sites

yeah you are :P

 

the only that comes close to what you want to do is literally switch the block when x event happens, you cant make different meta reference different class, you could always put all those method within the same class though :\

 

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Link to comment
Share on other sites

Ok, here's the actual scenario: I have a block with no collision that when powered will push entities upward, but also provide a weak redstone signal on its top to power any other blocks of that type above it, making it so you only have to power the bottom block. At the moment, it works perfectly, but I'm using 2 ID's. I'm not quite getting how to manipulate the metadata to do what I want. :P (P.S. The powered block has the same texture, and won't be in the creative menu.)

Link to comment
Share on other sites

the world class has 2 pretty handy method for your problem

getBlockMetadata(x, y, z);

setBlockMetadata(x, y,z );

 

use those and a switch (else if) to apply the effect you want to your block

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

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.