"When right clicked on block" Trigger won't work on water blocks

Published by Kierra Mac on Mon, 12/31/2018 - 06:32
Not applicable
Issue description

I was trying to create a procedure that a custom item triggers when right clicking on a water block. However, the provided xyz coordinates are always for whichever block is "behind" the water block I clicked. Both kinds of water blocks are being considered. If my "If" condition is false, it instead prints "Target must be water block," as shown in my "fml-client-latest" log:

[00:56:55] [main/INFO] [STDOUT/]: [mod.mcreator.mcreator_flask0RightClickedOnBlock:executeProcedure:48]: Target must be water block.
[00:56:55] [main/INFO] [STDOUT/]: [mod.mcreator.mcreator_flask0RightClickedOnBlock:executeProcedure:56]: Target must be water block.

...Which occurs every time I click on a water block. I know the procedure itself isn't the problem, because switching water blocks with a grass block will cause it to work as intended.

I'm not sure if this issue is fixable since it just seems to be the way water blocks work in Minecraft, but I thought it was worth a mention. (I have a kind-of-working work around so someone please let me know if I can post that here)

Attachment Size
Example of a procedure that doesn't work283.66 KB 283.66 KB
Example of a working procedure283.39 KB 283.39 KB

Issue comments

If you add new dependencies to the procedure that is already bound to the trigger, you need to open and just save the mod element that is calling the procedure again, so the dependencies get updated in the code. We will make sure this will be done automatically in the upcoming updates.

Hey, thanks for the quick reply. I did like you mentioned, and the issue still persists.

I don't think the problem is any dependencies or the procedure itself, because changing water blocks to grass blocks causes it to work just fine. As I said, I think it's just the way water blocks work in Minecraft. Here's an example.

"Looking at" coordinates for grass block

"Looking at" coordinates for water block

The game gives the same "Looking at" coordinates in the two images, even though I'm looking at the water block in the latter. This is why I don't think this is a very fixable bug.

I did some more testing today in relation to this. I'm positive the issue is not resolved by opening and saving the mod element that is calling the procedure. It would be helpful if updating dependencies was automatically done, but that won't fix this specific bug... Is there any place I can post a work around for my main problem?

For your main problem, the best place to post would be a forum topic so other users can find it. I am very glad that you are willing to share your solutions with others :)

Regarding updating dependencies, I will try to fix this in 1.8.2 already. For now, I will keep this ticket open until this second issue gets resolved.

About water this is not a bug every thing works fine problem actually is in Minecraft because in mc water block is designed to have impact on player movement but not on player targeting that's why on you picture coordinates are not changing because even if you are looking at water game is not registering this, in result its ignoring water and looks at the first closes block that can be destroyed by player. 

Perhaps bucket item and lilpads might be solution to this so I've recommend do research their code more deeply :) 

I am closing this ticket as MCreator 1.8.2 will automatically update dependencies of all procedure triggers.

Donate to MCreator

By donating to developers you can speed up development, as with more resources, we can dedicate more time to MCreator. It is a free project made by developers working on it in their free time.