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 modding (Java Edition)

Last seen on 20:30, 20. Sep 2022
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:

Last seen on 20:30, 20. Sep 2022
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Image doesn't seem to be…
Sun, 07/17/2022 - 20:36

Image doesn't seem to be showing here, so here is an imgur link to the image: https://imgur.com/TvyAOme

Last seen on 18:41, 13. Sep 2022
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

Last seen on 18:41, 13. Sep 2022
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.

Last seen on 20:30, 20. Sep 2022
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.

Last seen on 20:30, 20. Sep 2022
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.

Last seen on 18:41, 13. Sep 2022
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. 

Last seen on 20:30, 20. Sep 2022
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I got the same result after…
Wed, 07/20/2022 - 01:24

I got the same result after swapping the blocks. Image of procedure: https://imgur.com/a/Yxc8dKi