Item NBT Tags doesn't work/save/load correctly in any cases.

Published by aidanete on
Status
Fixed
Issue description

I don't know exactly was is happening, but the item NBT tags doesn't work any time I used them.

I've created an item that you can attach to a block, and then execute it from far away. The item should save its coordinates but when I try to execute it shows the message of non-attached that I put for these cases. I tried some other stuff with item NBT Tags and doesn't work, neither the (+NBT) thing shows up (I don't know if that should show up but doesn't show.)

Here I attach the procedures:

Issue comments

There are two cases where NBT might not work as it should

  1. You are setting it using client-side only trigger (procedure selector has computer icon next to it)
  2. You have something wrong with the procedure. Try printing procedure in the chat or in the console to see its actual values and how they change

I'm not setting any client-side only trigger. I did the printing procedure and I can see that all values remain on -1.

Done. The elements are PROAttachRemote, PRODetonateRemote and the item that uses them is RemoteDetonator

I have found the bug. The issue is that now MCreator by default copies the provided itemstack to a new stack due to some other issues. This causes that set nbt tag procedure sets it on the copy and not on the original itemstack.

I will revert the behavior so by default itemstack is not copied but referenced and require explicit copy for cases where copy is required.

This bug will be fixed in the next update. Thank you for your bug report.

You could edit procedure code and remove all calls to copy stack method in case where NBT is used, but do this only if you know Java.