Fluid tank fills and empties bucket at the same time

Started by siiiiid on

Topic category: Help with Minecraft modding (Java Edition)

Joined Nov 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Fluid tank fills and empties bucket at the same time

I'm trying to make a fluid tank that is interactable with buckets but when I try to take fluid out the bucket fills up and then immediately drains back in. How can I make it so it only drains or fills one bucket once per right click on the tank? 

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Sometimes for this sort of…
Tue, 11/14/2023 - 15:08

Sometimes for this sort of thing it can actually be helpful to make a really short timer to prevent double triggering stuff. You could either just use the 'cooldown item' function to literally cooldown the item a little bit, preventing the player from right clicking with it for a couple ticks or two; or if you want it to be more hidden, you can make a player-persistant number variable, have a procedure that decreases the variable by one every tick if it's above zero, check if the variable is at zero before allowing the right-click procedure to run, and set the variable to 10 or something whenever you successfully right click. 

Essentially, you need to build in a slight delay. There's some different ways you can do it.