Topic category: Help with Minecraft modding (Java Edition)
MCreator 2023.2
Mod being developed for Forge 1.18.2, with intent to port it to later versions once finished
I've come with an issue I've been having for the last few months. I'm trying to make a relatively simple mod, one feature being the player can fill a bucket with mana, draining a set amount of mana off of the player in the process. While the mana system itself isn't the issue (to my belief), should the player use a bucket to collect a water or lava source block and not intend to create a bucket of mana, their mana will be drained regardless upon bucketing the fluid. I can also confirm that this is the case with modded fluids, as Create's Chocolate fluid source block unfortunately has the same effect. Despite this, using a bucket on a vanilla cow, mooshroom and goat works just fine. I am unsure if this is the case with bucket-interactable modded mobs though. I've tried everything to try and fix this problem, from doing numerous checks and order configurations to trying my hand at return statements. Simply put, I ONLY want mana to be deducted from the player if a new bucket of mana has been created by them, nothing else. Here's what I have so far:
The main block of code (the created bucket is a placeholer item, separate from MC's vanilla milk bucket) - https://imgur.com/a/1bTBHDx
The return statement it calls upon - https://imgur.com/a/PM39wFi
For context, the original return statement procedure was derived from this thread - https://mcreator.net/forum/98180/how-check-block-im-looking-water
and the mana system I'm using was created using this tutorial - https://youtu.be/3RaCK0_PMWE?si=03Q-JY5ejz5ge8S6
I have a feeling this will probably be an easy fix, but let me know if and when you find a solution to it.
Please and thank you, RubberCream
Maybe there is a way to check if another bucket was added to the player inventory, and if that statement is true, deduct the mana then? Else nothing