Topic category: Help with MCreator software
So I have an item that you can use on the ground to spawn blocks.
The trigger used in this item looks like this.
I'm assuming itemstack is the stack the player right clicks with. I'm unsure what else it could possibly refer to.
I want the item to be consumed after the player performs this action. The "YuccaRootPlanted" procedure looks like this.
I've collapsed everything here that works to avoid confusion. The sole issue arises with that "shrink itemstack" block.
It simply... doesn't work. The entire rest of the procedure is completely functional, everything else works exactly as intended, but the item used is not consumed. I've tried both shrinking as seen here, as well as just setting the number of items to the number of items minus one. Neither worked.
I must be missing something fundamental here, as this is literally the only thing I cannot get to work. Does anyone have any insight as to what I'm doing wrong here?
If you want to add images you need to upload them externally, and then copy the URL, the images are broken so it's a bit difficult to tell.
I guess I would assume it's something with the way you're referencing the itemstack. "Provided itemstack" is different from the item in the main hand of the player; some ways of reffering to itemstacks actually give you the itemstack, (in which case you can shrink or grow that itemstack), and some just make a copy of that itemstack that you can get data from, but can't directly modify, and it isn't always clear which ones do which.
In your case, if you're running a procedure through itemstack tick, that will run whenever the item is in a player's inventory, regardless of whether it's being held. If you want to make an item that can place blocks, you would instead want to use the 'when item right clicked on block' trigger, or make a procedure with the global trigger 'player right clicks on block.' Then, check if the item in the main hand of the entity, (using the 'get item in main hand of entity' function, from the entity management tab), is your desired itemstack. if it is, use the 'shrink itemstack' function, but replace 'provided itemstack' with 'get item in main hand of entity.'
Aha, that did it!! I swapped the itemstack with 'get item in main hand' and it works perfectly! Thank you so much!!
I'm unsure what happened with the images; it works on my end and I did upload them externally. That's a bit strange. At least it didn't get in the way of finding the right answer :)