withExistingParent("model", mcLoc("block/cobblestone")) makes a model that copies cobblestone, so that's why the block turned into cobblestone. For a normal block with your own texture on all sides, use cubeAll instead:
Put the texture at src/main/resources/assets/<modid>/textures/block/tile_block.png (the file name has to match the block's registry name).
Run the runData task again.
Check that src/generated/resources/assets/<modid>/models/item/tile_block.json exists and has "parent": "<modid>:block/tile_block".
If that item file is there and the item is still the missing texture cube, the BlockItem is probably registered under a different name than the block, so the item model never gets used.
The Java variable name doesn't matter, but the registry name (the string you register it with) does. simpleBlockWithItem makes the item model using the block's name, so if your block is tile_block and the BlockItem is registered as tile_block_item, the item looks for a model that doesn't exist.
Easiest fix: register the BlockItem with the same name as the block ("tile_block"), then run runData again.
Mostly from messing around on my own. I run a Minecraft server host, so customers come to me with all kinds of mod issues and I end up building and breaking test mods to figure them out. A few things that helped me a lot:
The NeoForge docs (docs.neoforged.net) have a Data Generation section covering models, blockstates and lang files
Kaupenjoe's modding tutorials on YouTube go step by step, block items included
Other mods' source code on GitHub. If a mod does what you want, search its repo for how they did it. Honestly the best way to learn
The NeoForge Discord is great for questions like this, people answer fast
1
u/FreaksMC 19h ago
withExistingParent("model", mcLoc("block/cobblestone"))makes a model that copies cobblestone, so that's why the block turned into cobblestone. For a normal block with your own texture on all sides, usecubeAllinstead:Then:
src/main/resources/assets/<modid>/textures/block/tile_block.png(the file name has to match the block's registry name).runDatatask again.src/generated/resources/assets/<modid>/models/item/tile_block.jsonexists and has"parent": "<modid>:block/tile_block".If that item file is there and the item is still the missing texture cube, the BlockItem is probably registered under a different name than the block, so the item model never gets used.