Testing for block

Started by dawox99 on

Topic category: Help with MCreator software

Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Testing for block

Hi. Im new in MCreator and im trying to create mod with energy, but I need test for block near other block, because there is only global variable. I need to change one variable to true and get value from other. My procedure looks like this: Procedure

But it's not working, while I place solar panel near "cable" it's still false and still not getting energy from solar panel (solar panels are working, I checked them). 

Joined May 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Ah, yes. This stumped me for…
Fri, 09/20/2019 - 02:36

Ah, yes. This stumped me for a while too. When you test for blocks, don't use the '==' comparison block. Just use the one with a single '='

Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thanks for your reply! I…
Fri, 09/20/2019 - 14:56

Thanks for your reply! I already fixed this, I though it scans in some radius for block but i see my mistake... Now my code looks like  this if somebody is interested: Procedure

I suggest you check our…
Fri, 09/20/2019 - 16:41

I suggest you check our tutorials collection playlist on our YouTube channel which contains many examples and tutorials that can help you get started with MCreator: https://www.youtube.com/playlist?list=PLAeL-oIFIEngE6jRgFYeFMfuj8WQsO3Ei

Joined Aug 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hey dawox. I'm not sure if…
Fri, 09/20/2019 - 20:54

Hey dawox. I'm not sure if you need this: but if you don't want to use a global variable, but a variable for a specific block:

Global variables do not belong to any specific block. Local variables (I think) only exist during the instance of a procedure call...

but there is a third type of variable, which I think is the one you might be looking for, which is called the NBT tag. An NBT tag is a variable specific to a block/entity etc and can be used throughout different procedure calls. For example: 

When block added: Set NBT number tag to 0. On block tick update: NBT number tag = NBT number tag + 1.

If you want a block to store a boolean then you need to create an NBT logic tag. (Enable storage for that block but set slots to 0)