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

Published by aidanete on Tue, 07/02/2019 - 18:30
Upvotes: 3
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:

Attachment Size
Remote Procedure66.9 KB 66.9 KB
Attachment Procedure64.8 KB 64.8 KB
Workspace264.7 KB 264.7 KB

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

Submitted by aidanete on Wed, 07/03/2019 - 12:11

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

Please attach a workspace with printing here and tell me which mod elements to check.

Submitted by aidanete on Wed, 07/03/2019 - 13:05

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

Submitted by aidanete on Wed, 07/03/2019 - 13:50

Yes, and from attachremote it executes detonateremote

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.

We will add progress bar on the website soon so you will be able to track its progress.

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.

lol I know a little Javascript and a little C++, but I don't know java

Donate to MCreator

By donating to developers you can speed up development, as with more resources, we can dedicate more time to MCreator. It is a free project made by developers working on it in their free time.