Right click on block without placing the item in hand

Started by MinerMew on Tue, 08/04/2020 - 20:26

Topic category: Help with modding (Java Edition)

Last seen on 03:05, 11. Apr 2022
Joined Jun 2019

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Right click on block without placing the item in hand
Tue, 08/04/2020 - 20:26

I'm making a mod where you can breed flowers by right-clicking them with another flower in hand. So, when you right-click a red flower with a yellow flower, you get an orange flower, and so on.

I want to integrate flowers that are already in vanilla into the mod, and I have the right-click working on them to get a new flower, but when I right-click on them it places a flower next to the block as I get the hybrid flower. For example, when I right-click a red rose bush with a modded yellow rose bush, a yellow rose gets placed in front of me, the yellow rose in my inventory is gone, and I ALSO have a new orange rose in my inventory.

This doesn't happen with the modded flowers, only vanilla ones. I'm wondering how to stop flowers from being placed if they are consumed in the breeding process.