What A* needs to work is the following:
- Given the current node, get the list of possible nodes it can move to, with their costs.
- The ability to evaluate the heuristic function.
Please notice I've said nothing of a grid. A* will work with any graph, with nodes and links. If you could have the graph pre-made, you would just execute on the graph. But you don't have to. So, instead of having links, we will have a function that give you the neighbors of a node.
For your case, of course, the nodes would be the cubes/blocks/cells/voxels of the world. And you will have reference to them. Given that we are talking Java, perhaps you have a reference type for the nodes. Alternatively, you have them in some indexed data structures, and you can reference them by that index (the index could be the 3D coordinates, for example).
So, you will have a function that takes a reference to a block, and gives you a array/list/iterable of the references to the blocks the character can move into. Considering whatever mobility options are available (e.g. walking, jumping, swimming, and so on). Those would be the links.
You would do that by querying the neighbor blocks to the given one, checking what are they of, and determining whatever or not the character could move there.
However, you also need the costs. You probably are better off computing that at the same time, in which case you would not return references to blocks, but pairs of references to blocks and costs. Another option is to have a function that will take references to two neighbor blocks, and tell you the cost.
What is the cost? Well, presumably it consider mobility options and terrain type. For example: walking over mud costing more than walking over stone (that is, the character walks faster/easier on stone than on mud), or for example jumping costs more than walking. And if you can't go there, you can say cost is infinite.
Note: You could have a pre-computed graph with all information, perhaps update it when a block changes, and execute A* there. In fact, you could store store that in the same structure in memory that has the blocks (so each block would know how much it cost to move from it to its neighbor blocks).
And of course, you need the heuristic function is an estimate of the cost to get to the goal. Presumably you would start by the distance in strighline to the goal, perhaps add extra cost for verticality (i.e. if getting there must require at least x jumps, and each jump costs z more that walking, add x*z extra to the heuristic).
Now, you can implement A*. Go find the pseudocode somewhere. For example: A* pseudocode on wikipedia. Or try Rosetta stone. I will also advise to read about some variants and optimizations. In particular Iterative Deepening A* and Memory bounded A*.
I suppose you will have to modify the code anyway. And thus I should advocate for you to understand it. And for that, I think you should start by understanding Dijkstra's Algorithm. I'll let Computerphile help with that:
Addendum: See also Amit Patel's Introduction to the A* Algorithm at Red Blob Games.