Started by
LILTreyman
on
Topic category: Help with Minecraft modding (Java Edition)
As the title says, I am trying to figure out how to change an item into a different item when I right click a certain block. I am a newbie to MCreator, so I don't know what I'm doing wrong. The trigger I am using is "When right-clicked on block (block pos.)." The "certain block" here is a fluid. Here is the block code:
Image doesn't seem to be showing here, so here is an imgur link to the image: https://imgur.com/TvyAOme
Heya so you cant check for a fluid the same way you check for a block. I just quickly made a procedure and tested it. Instead of checking for a block you'd want to check for a fluid. However because in minecraft, looking at fluid makes you look at a block behind the fluid. You'd instead want to use raytracing with local variables to check for it
Procedure: https://imgur.com/HZYuJvK
Where to put it: https://imgur.com/a/ILoQszK
Oh yeah, you can also change it from Source Only to Any if you want the flowing version to also do this. Just change the lava to your fluid, and the diamond to the end result.
This partially worked, but for whatever reason, the item becomes the other item, then turns back into what it originally was.
UPDATE: This does work, but only if there is an available hotbar space anywhere on the left of the item. If there is not, in creative mode, nothing happens to the item other than appearing to become the other item for about 1 frame, then changing back to the original item. In survival mode, the item will simply disappear, and no new items will be added to your inventory.
I tested it with an entirely free inventory other a bucket of lava and a test item I made. Could you show me the procedure you made.
On creative mode, the item being transformed should go down then up one AND the new item should appear, probably happening because of shrink item stack. So you could swap these two which might solve that problem: https://imgur.com/lB0BCyf (note im too tired to currently test that, though that runs into the dilemma that if the have two of the items it may take from a different slot instead of the one in their hand.
And for me, on survival mode, the first item disappeared and the second one appeared at the same time. It's quite weird it would disappear and the new item wouldn't disappear considering those two blocks run together.
I got the same result after swapping the blocks. Image of procedure: https://imgur.com/a/Yxc8dKi