Trying to figure out how to make an item turn into another one when right clicking a certain block

Started by LILTreyman on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Trying to figure out how to make an item turn into another one when right clicking a certain block

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:

Joined Jun 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Heya so you cant check for a…
Sun, 07/17/2022 - 22:26

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

Joined Jun 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Oh yeah, you can also change…
Sun, 07/17/2022 - 22:28

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.

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
This partially worked, but…
Mon, 07/18/2022 - 00:01

This partially worked, but for whatever reason, the item becomes the other item, then turns back into what it originally was.

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
UPDATE: This does work, but…
Mon, 07/18/2022 - 00:32

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.

Joined Jun 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I tested it with an entirely…
Mon, 07/18/2022 - 02:46

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.