Started by
fireboyev
on
Topic category: Help with Minecraft modding (Java Edition)
How do you make a bucket for a fluid that you can pick up and place properly like a normal water/lava bucket
Topic category: Help with Minecraft modding (Java Edition)
How do you make a bucket for a fluid that you can pick up and place properly like a normal water/lava bucket
Last time I checked, not really possible. You could probably do it with variables and such.
Easy.
1. Create your bucket item (containing fluid) and your custom fluid, if applicable. but we'll cover the item first.
2.when you get to events click on "When right clicked on bock"
3. Under "conditions" select "itemInPlayersHand[] == yourbucketitem"
4. Hit "add event" right beneath the condition
5. Under "conditions" select "itemInPlayersHand[] == yourbucketitem"
6. On the left scroll selection, select "add block" and select your fluid as the block to be placed. Set the coordinates to j+1 so as not to delete the block you click on.
7. Click on "add event" at the BOTTOM, repeat step 4 and 5
8. On the left scroll screen selection, select "add item to inventory" and select the empty bucket, and the drop to 1
9. Click on "add event" at the bottom
10. Repeat step 7
11. On the left scroll selection, select "Consume Item in inventory" and set it to your bucket item.
Voila, a bucket that will place your fluid.
To pick the fluid up, just reverse the process via the fluid blocks "on right clicked" event and give it the condition of "iteminplayershand == emptybucket" -> "add item to inventory" -> bucket o' fluid (plus a "consume item from inventory" to remove the empty bucket)
There is a problem though because you can not do events on fluids so I can't make it pick up the fluid
Is there a custom code i could add?
@#4 make a new block, add the events you want, recompile, copy the code and paste it into the fluid class
@#4.1 What code? You didn't give a code.
@#4.1.1 ._.
Do what I said above, then click on view source and copy the code and paste to the fluid source code
@#4.1.1.1 and that will make it so I can make a bucket how exactly?
Pretty much You need to make the bucket item, that being the bucket witht he fluid in it.
Then
Make a block *being the liquid* and have it so, if clicked with a bucket, it would remove the block, and place it in the new - bucket.
And if the user clicks on a block, then place it where it was clicked. The block does the physics and what it needs to do, on its own.
However he's not going to give you a step-by step tutorial, or the code on how to do it.