[Solved] Custom bucket won't fill or place properly

Started by JayTheTaco on

Topic category: Help with modding (Java Edition)

Last seen on 07:50, 29. Dec 2021
Joined Nov 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
[Solved] Custom bucket won't fill or place properly
Wed, 01/29/2020 - 23:55 (edited)

So I made a custom liquid named acid and originally I was gonna use the auto-generated bucket however I learned that there are no ways to use it in crafting recipes and there is no way to give it to the player via commands (That last part is important due to a specific block I have in my mod, but it's not important for this discussion)

 

So I opted to create a custom bucket for it.

I created the "acid-proof bucket"

       To get it working I created the following procedure (Triggered when item right-clicked on a block):

  • If Get block at x: X y: Y z: Z = Acid
  • do:
    • Place Air at x: X y: Y z: Z
    • Remove 1 acid-proof bucket from player inventory
    • add 1 acid bucket to player inventory

and the "acid bucket"

       To get it working I created the following procedure (Again, triggered when item right-clicked on a block):

  • Place Acid at x: X y: Y z: Z
  • Remove 1 acid bucket from player inventory
  • add 1 acid-proof bucket from player inventory

So what's the problem?

when right-clicking the acid with the acid-proof bucket, for some reason it doesn't get rid of the acid nor does it give me the filled version of the bucket (and yes, I made sure it was a source block). I think the problem is that Acid is technically a fluid, and has no collision box. I don't know for sure though.

 

When right-clicking a block with the acid bucket, it would place acid, but it would replace the block I right clicked, rather than the blocks adjacent to it. I think this is because I have it place acid on the coordinates of the right-clicked blocks, and not the coordinates of the adjacent air.

 

now, if I know the problem, why don't I solve it myself? well if you couldn't tell, It's because I couldn't find a solution. I couldn't find anything related to right-clicking a fluid, and I couldn't find any procedure blocks that let me place a block to the adjacent blocks. 

 

If anyone knows the solution to either of these problems, it would mean a lot.

Thank you for your time!

- Jay

Edited by JayTheTaco on Wed, 01/29/2020 - 23:55
Last seen on 10:33, 3. Jul 2022
Joined Jan 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
This is what I have done:…
Wed, 01/29/2020 - 21:34

This is what I have done: https://imgur.com/a/zlXYia0

That needs a few things added, like not emptying the bucket in creative, and will only work for placing/taking liquid from the top face of a block, but it's a start.

By the way, since you are working with fluids I hope you can help me with this: do you know how to change the colour of my liquid? As you can see in my images, my fluid's texture is a very translucent white. But in-game it looks just like regular water. I guess this is related to some overlay (possibly biome specific?) that's interfering, but I have no idea on how to change that.

Last seen on 07:50, 29. Dec 2021
Joined Nov 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you for helping! As…
Wed, 01/29/2020 - 23:22

Thank you for helping!

As for your problem, the only possible problem I could think of is the water still and water flow images using the same texture as the water one. 

Last seen on 10:33, 3. Jul 2022
Joined Jan 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
That might be it. My…
Thu, 01/30/2020 - 00:09

That might be it. My textures are just the water textures with the values changed a bit. I'll have to try again later.

Good luck with your modding!

Last seen on 22:45, 8. Mar 2020
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If I may ask, where did you…
Sat, 03/07/2020 - 18:00

If I may ask, where did you put the code of the image? because if I want to remove the liquid I can't edit empty bucket code and without any trigger option if I just straight up make a procedure copying what you did it happens each time it happens each time I right click on the fluid even if I'm not using a bucket

Last seen on 08:33, 9. Apr 2020
Joined Nov 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I found something that works…
Mon, 03/16/2020 - 21:15

I found something that works.  But it reads only the block directly above the one being looked at, not any other blocks all around.  So the player needs to keep moving the crosshairs around a little.  But it works, anyway.

https://ibb.co/vPnnVL2

 

Last seen on 01:52, 25. Mar 2020
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Where do I find the Item in…
Sun, 03/22/2020 - 16:48

Where do I find the Item in entitys hand string.

Last seen on 08:33, 9. Apr 2020
Joined Nov 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Under "entity procedures"…
Sun, 03/22/2020 - 20:15

Under "entity procedures" you'll find both "Item in entity's main hand" and "Item in entity's off hand".

Last seen on 08:33, 9. Apr 2020
Joined Nov 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I updated the code (https:/…
Sun, 03/22/2020 - 20:19

I updated the code (https://ibb.co/w04CnBs.&nbsp).  This new code checks to make sure there is a block of empty air above the one being right-clicked, and if there is air there, it will put a block of water there.  The previous code I posted would instead remove whatever block is above the one right-clicked (even stone and such) and put water there.

Last seen on 08:33, 9. Apr 2020
Joined Nov 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Oh, and there is an issue…
Sun, 03/22/2020 - 20:25

Oh, and there is an issue with this way of filling the container, in that it will fill from any water tile, regardless of whether it is still water or flowing water.  This is different from the vanilla iron bucket, which fills only from still water and not from flowing water.  I can't figure out how to replicate this behaviour with the custom bucket; that is, how to get it to fill from just still water and not from flowing water.  I wrote a topic on it in the forum.