(SOLVED) Help with Variable/Block Data?

Started by Nanobott on

Topic category: Help with MCreator software

Joined Feb 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
(SOLVED) Help with Variable/Block Data?
Thu, 06/13/2024 - 15:11 (edited)

For example, ill use a custom block; Table. right click the Table to open it's gui, press play and a random number 1-10 generates. For this one ill say 7. So the gui text says 7 for eveyone who opens this placed table gui.

Now i place another table, open the gui and press play. This time is says 5. So everyone who opens this table's gui will see 5 but when they open the other table it says 7.

How can i make this work? 

It must be the same block and the same gui. For every block thats placed it needs a different random number that i can change using other procedures. 

This video shows how it should not be, The left one should still be 8 and not 5, the right one should stay at 5 after ive hit play on the left one.

https://imgur.com/a/tIgCx8A

 

 

Made it work using NBT data! Simply enable entity for the block, (set slots to 0 if necessary) And use "set nbt number tag (test) to (blabla example 3)" And use "return text: format number: Get NBT Number tag "Test" of block at: x:X y:Y z:Z if it has block entity. as "##.##"

Edited by Nanobott on Thu, 06/13/2024 - 15:11
Joined Jan 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I think you can use NBT data…
Wed, 06/12/2024 - 03:29

I think you can use NBT data in the block and not variables

Joined Feb 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How should i use that to…
Thu, 06/13/2024 - 14:49

How should i use that to make it work like i said ?

Joined Feb 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thanks Pizz4Ninja!  
Thu, 06/13/2024 - 15:13

Thanks Pizz4Ninja!