Testing for block

Started by dawox99 on Thu, 09/19/2019 - 21:33

Topic category: Help with MCreator's application

Last seen on 18:47, 20. Sep 2019
Joined Sep 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Testing for block
Thu, 09/19/2019 - 21:33

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). 

Last seen on 13:57, 12. Oct 2019
Joined May 2014
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
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 '='

Last seen on 18:47, 20. Sep 2019
Joined Sep 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
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

Last seen on 21:46, 14. Oct 2019
Joined Aug 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
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)