Set an object location according to a texture

Hello, I need to set an object location according to a texture, as the title says.
It just needs to be the Z location, as I have a plane that uses vertex displacement and the UV moves around and rotates, the cube is supposed to be stuck to it but needs to respond to the changes of height as it’s the player. I’m using a procedural noise texture from cycles. Technically I think I’ll be able to set up the uv’s with Haxe (actualy I won’t) but have no clues about how to retrieve the pixel values of the texture and use it in a correct manner to set the Z location of my cube. I really appreciate you reading this and maybe giving me a hint or piece of code.