Block filling

I need to have a block that has an opacity of around 50 that is ghosted but when it gets near a cube named ic and the button ‘e’ is pressed it needs to place a block the same size but fully visible and not ghosted. But the catch is the properties. I need certain resources to be required. Like wood for example. They would find wood then the property would go up to 20 then they would go up to the block and use 5 wood to make it. But the property resources collected property needs to be in the player not the block. How do I fix this?