Started by
AOCAWOL
on
Topic category: Help with Minecraft modding (Java Edition)
Hi! So I've been working on crops for a while and I finally have it working except one thing:
Example:
I right click a Strawberry on farmland and it works fine but if I remove the strawberry from my main hand it still does this. Does anyone have a procedure that would work or could tweak mine so that it only places the crop if it's in the main hand? Thanks in advance, here is the procedure I use:
The link does not seem to work from me.
One idea would be to check for the item in players the main hand and make sure there is a crop and check that it is not in the offhand. You have procedures to get the current item in the main/off hand.
Sorry for the late reply! Anyway, try this link https://i.imgur.com/D52lY4y.png I tried making where it said "Has provided Entity (Strawberry) = Main Hand" before but what it did was just place it even if I didn't have the strawberry in my inventory or main hand? If You could send some kind of visual of what to do that'd be appreciated!
Just add another if around the current one and do the same check as for checking block at, just check the item in hand. Could you show your screenshot of your current procedure with item in main hand checking too?
Hi! I actually figured it out! I was very stupid and didn't realize there was a template already for something like this (regarding my problem) thank you!
Cool, no problem :)