Class MilkBucketItem

    • Constructor Detail

    • Method Detail

      • initCapabilities

        public ICapabilityProvider initCapabilities​(ItemStack stack,
                                                    @Nullable
                                                    CompoundNBT nbt)
        Description copied from interface: IForgeItem
        Called from ItemStack.setItem, will hold extra data for the life of this ItemStack. Can be retrieved from stack.getCapabilities() The NBT can be null if this is not called from readNBT or if the item the stack is changing FROM is different then this item, or the previous item had no capabilities. This is called BEFORE the stacks item is set so you can use stack.getItem() to see the OLD item. Remember that getItem CAN return null.
        Parameters:
        stack - The ItemStack
        nbt - NBT of this item serialized, or null.
        Returns:
        A holder instance associated with this ItemStack where you can hold capabilities for the life of this item.