NBT Block Variables Don't Work Properly

Issue description

Hello Klemen, I may have found a bug, I was going to do a NBT variable tutorial and I was setting the workspace all up for a block, when I noticed that no variable was working for a right-click event, I am trying to print the variables to chat, however the variables don't seem to get passed over all the way with the proper data, Text is not showing up and number always remain at -1.0 I am not sure if True or False statements are working or not at the moment for blocks but I would say maybe not.

I did not see any errors when right-clicking the block. I also tried to set the variables under When Redstone On thinking it may be getting confused with the player right-clicking so I left the right-click to just print the variables however, it did not fix the issue. I am not sure if entity variable work I have not tried them so it may be worth checking to see if they work or not.

Anyhow the log and the workspace that was going to be for the tutorial is below, I don't think however I will be making the tutorial for that on Friday unless you can push out a small patch before then. probably not but, I just wanted to let you know about this as it seems more probable that its broken the more I test it.

Issue comments

I just checked entities, and I number variables are also not working for entities NBT. I may be the same issue, I tried making a simple timer using

SET NBT (NBT + 0.05) (Entity Update Tick)

If NBT > (Number in seconds)

Do:

  1. Despawn entity
  2. Spawn New Entity
  3. Set NBT (0)

The code never ran after the time was up.

So it may be due to the changes in NBT.

Anyhow I just wanted to update this post for this issue.

 

For block NBT tags, make sure to enable tile entity so the data can be actually stored somewhere:

Enable tile entity

This field needs to be checked but is not in the block from the workspace you attached.

For entity NBT, I did this test which makes entity strike lightning each 5 seconds and it worked in my case (triggered on entity tick update):

Entity NBT

Thanks for your reply Klemen.

For the block I think I may have forgotten to enable that, I can't remember doing that, so it could be just user error on that one XD

For the entity NBT I had the same thing but I did not have the "Print" code and for the event I had despawn entity and spawn entity, I will have to play around with that some more, I will comment below latter.

For the entity NBT I had the same thing but I did not have the "Print" code and for the event I had despawn entity and spawn entity, I will have to play around with that some more, I will comment below latter.

If you can make an example for the entity NBT, attach the workspace here and leave a comment or open a new ticket and I will check it out and see if there is a bug and fix it if this is the case.

I have the same exact problem as this, but I actually do have tile entity enabled