Posted March 26, 201411 yr Hello everybody! I'm new to modding, and I have some questions. First of all, how does one create a block that can interact with a bucket? I'm trying to creat a block that when right clicked on with a bucket, it fills the bucket like a water source block. However, i don't want this block to dissapear. Does anybody know how to go about doing this? Help would be much appreciated. Thanks!
March 26, 201411 yr You can do it in the onBlockActivated in the block class you just check if there where right clicked with a bucket. you can find a example on pretty much what you are looking for in my mod: https://github.com/simwir/Creative-supplier/blob/1.7/main/java/simwir/cs/blocks/BlockFluidSupplier.java or mayby if you're looking for a block that only can fill one type of fluid you might want to look at my other mod: https://github.com/simwir/Compact-Tanks/blob/master/main/java/simwir/ct/blocks/BlockWaterSource.java
March 27, 201411 yr Author Thank you, this really helped a lot. However, I have one question. What is performed in the ItemUtils.comsumeItem(heldItem)? I do not have that package.
March 27, 201411 yr Author Ah. I fixed it by replacing it with new ItemStack(Items.bucket, heldItem.stackSize-1). Thank you!
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.