Started by
liang233
on
Topic category: Help with Minecraft modding (Java Edition)
Sorry for my poor English
I was trying to make a machine to give an item a custom attribute(using NBT)
Then I need to add NBTs to the itemstack in the machine.
My Procedure
Full Procedure: https://drive.google.com/file/d/1hViKzmZGCgaf7msl1PX0EJsbzJstknlJ/view?usp=sharing
But it seems that this doesn't work
The NBT tag is not added to the itemstack.
Anything wrong with my procedure? Or there are bugs in MCreator?
(Any other solution is OK.)
Full Workspace: https://drive.google.com/file/d/17is6Foi9pur2NTLS5PZ5W7i7Wy2zQ8ZM/view?usp=share_link
Thank you for your help :)
Edited by liang233 on Sat, 01/21/2023 - 13:44
Procedure blocks "get a copy of itemstack" give you a copy of a stack in the slot, not original stack. So this means you are not assigning NBT to the stack in slot but to its copy.
You need to store copy of that stack to a local itemstack type variable, assign NBT to this variable itemstack and then set item in slot to that variable
Thank you :)