Started by
dawox99
on
Topic category: Help with MCreator software
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:
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).
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 '='
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:
noice lmao
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
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)