Suspected issue with Get copy of item in slot [number]

Started by MrScautHD on

Topic category: Help with Minecraft modding (Java Edition)

Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Suspected issue with Get copy of item in slot [number]
Fri, 07/17/2020 - 19:18 (edited)

Hello, so I created a procedure that is triggered under block tick. As shown in the procedure (see attached) I have added many prints that include, the item in slot 0, the nbt value of "Energy" in accordance with the item in slot 0 before and after the change. All prints work and show their respected values, however, the NBT change doesn't happen. This led me to believe it was an issue with the, [Get copy of item in slot 0] procedure block, however it returns correctly. Attached gives the workspace and the procedure.

File:

https://cdn.discordapp.com/attachments/724161404180889630/7333481836141…

bild1

bild2

 

 

Edited by MrScautHD on Fri, 07/17/2020 - 19:18
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
pls help :(
Tue, 07/21/2020 - 09:46

pls help :(

Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
every time you call the "get…
Tue, 07/21/2020 - 17:28

every time you call the "get a copy..." code block it makes a new itemstack that's a copy of the old one. you're not saving the copy anywhere so its lost. why use a copy anyway? why not just use the original itemstack?

Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
how make this with the…
Wed, 07/22/2020 - 10:31

how make this with the Original itemstack?

Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
i was wrong. i looked at the…
Wed, 07/22/2020 - 12:57

i was wrong. i looked at the generated code and seems like its returning the itemstack.

you change a lot of nbt tags in that procedure, does the other nbt tags get saved correctly?

Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
yes the other is correctly…
Wed, 07/22/2020 - 14:43

yes the other is correctly but the other is a block and not a item only the item is not working

Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
just because you stated your…
Wed, 07/22/2020 - 22:22

just because you stated your issue so clearly, i am compelled to help find the problem. i've never used the 1.15.2 generator before so i had to create a new 1.15.2 project just to see what was going on (on the 1.12.2 generator using that red code block gives you the actual itemstack but 1.15.2 generator makes a copy)

from what i've found, a simple way to solve this is to put the copy back into the slot after you've changed the itemstack, like so:

https://cdn.discordapp.com/attachments/599250311852458006/735622248165277746/Untitled.png