I found a BUG! NBT Tag values hold their original real value while secretly resetting it to 0 for selective components.

Started by StellaeLux on Wed, 09/18/2019 - 14:26

Topic category: Bugs and solutions

Last seen on 12:29, 18. Oct 2019
Joined Aug 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
I found a BUG! NBT Tag values hold their original real value while secretly resetting it to 0 for selective components.
Wed, 09/18/2019 - 15:25 (edited)

What I'm about to describe is a situation that was so strange that it made me lose my sanity. What happened here is impossible...~

I Created a procedure that simply sets a value to 0 only upon joining a world for the first time:

------------------------------------------------------------------------------------

Event Trigger: Player joins the world

If not Get entity data logic NBT tag "JoinedBefore"

   Do Set entity data logic NBT tag "JoinedBefore" to true
   Do Set entity data number NBT tag "Counter" to zero

------------------------------------------------------------------------------------

So I created 2 Overlay elements with only a slight difference. They become visible after the counter hits 1 for the first overlay and when it hits 2 for the 2nd overlay:

------------------------------------------------------------------------------------

Condition true if: Get entity data number NBT tag "Counter" > 0
Condition true if: Get entity data number NBT tag "Counter" > 1

------------------------------------------------------------------------------------

I simply made food to be able to (test) increase the counter to test whether the Overlay elements become visible.

------------------------------------------------------------------------------------

On Food Eaten:

Set entity data number NBT tag "Counter" to Get entity data number NBT tag "Counter" + 1

------------------------------------------------------------------------------------

I even created an additional "print" for testing to be able to see the value for myself:

------------------------------------------------------------------------------------

On food right clicked

Send message to provided entity create text with "Counter: "

                                                  Get entity data number NBT tag "Counter"

Show in action bar: false

------------------------------------------------------------------------------------

So here I go starting up a new world. I right click and yup: Counter = 0. Neither overlay elements are visible. (As intended)

So I eat the food once and there you go! Now the counter is 1 and 1 overlay element is visible. (As intended) Eating food for the 2nd time makes the 2nd overlay element visible! (As intended)

So I close the world and reopen it, to find out that the NBT counter is still 2... as intended! But yet... the overlay elements have both gone missing and only appear upon increasing the NBT counter to 3 and for the second... 4...

The value is literally saved. Counter is visibly 2, yet in the overlay procedure it returns False for Get entity data number NBT tag "Counter" > 0...

Every time you close the world and reopen it, it treats Counter as if it is 0 in the Overlay system, yet when printing it's value, it is not...

How is this possible?

Edited by StellaeLux on Wed, 09/18/2019 - 15:25
Last seen on 12:29, 18. Oct 2019
Joined Aug 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Okey, I definitely found a…
Wed, 09/18/2019 - 15:22

Okey, I definitely found a bug of some sorts. I did some testing around:

I created a BLUE block that makes a dirt sound when placed ( through basic settings) and added this procedure:

------------------------------------------------------

When block is places by:

if Get entity ta number NBT tag "counter" > 0

Do place STONE at x y z

------------------------------------------------------

When loading the world up for the first time and placing this block (counter = 0), you'll place the BLUE block with a sand sound.

When increasing the counter to 1, the block will now spawn stone with the stone sound.

When reloading the world with counter = 1 you will still spawn the Stone block but THIS TIME with a sand sound! Only after you increase it to 2 will it start spawning with a stone sound!

 

The bug somehow resets an NBT tag back to 0. So if you have a condition where if x > 5. If you reopen the world with x being 7, you'll need to reach 12 because it somehow treats x as 0 instead of 7, while treating it as 7 for different parts of the program!

When it comes to placing the block, it works, but strangely for the sound aspect of it, it doesn't. And it also doesn't work in the Overlay procedures.

I hope that helped.

Last seen on 12:29, 18. Oct 2019
Joined Aug 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
If this delays the beautiful…
Wed, 09/18/2019 - 15:31

If this delays the beautiful update that is 1.9.1, I'm sorry xD

Overlays are client-side,…
Wed, 09/18/2019 - 16:46

Overlays are client-side, while events happen on both server and client-side. Related tickets and resolutions that will be published in 1.9.1:

Make sure that you are getting/setting NBT tags on the same side too as there are two contexts for variables - server and client context. For global variables, MCreator will sync them in 1.9.1.

Last seen on 12:29, 18. Oct 2019
Joined Aug 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
How can I create client side…
Wed, 09/18/2019 - 18:49

How can I create client side variables that persist upon leaving and rejoining the world?

Not yet, will be possible in…
Wed, 09/18/2019 - 19:15

Not yet, will be possible in 1.9.1.

In 1.9.0, you can make a server-side variable and then copy it into a session variable for the overlay use.

This page might help: https://mcreator.net/wiki/variables

The video on this page explains how to do this in 1.9.0 and how one will do this in 1.9.1.

Last seen on 12:29, 18. Oct 2019
Joined Aug 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Damn, 1.9.1 sounds amazing…
Wed, 09/18/2019 - 20:26

Damn, 1.9.1 sounds amazing. So many useful things. I can't wait xD