Jump to content

[1.19.3] Custom blocks not showing models or textures


GSR

Recommended Posts

I'm having a problem I can't figure. My blocks always show with the missing texture texture, and the basic cube model when placed, ignoring the associated json file located at: "src/main/resources/assets/gsr_yatm/models/block/large_copper_heat_sink.json". But, if I copy the file exactly into: "src/main/resources/assets/gsr_yatm/models/item/", it'll render the model and textures correctly for the BlockItem form, oversized in hand and so, but still correctly.

 

For example the declaration and registration of a block I'm using.

public static final String MODID = "gsr_yatm";

public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, MODID);
public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, MODID);
	
public static final RegistryObject<Block> LARGE_COPPER_HEAT_SINK = BLOCKS.register("large_copper_heat_sink", () -> new Block(BlockBehaviour.Properties.of(Material.STONE)));
public static final RegistryObject<Item> LARGE_COPPER_HEAT_SINK_ITEM = queueForGeneralCreativeTab(ITEMS.register("large_copper_heat_sink", () -> new BlockItem(LARGE_COPPER_HEAT_SINK.get(), new Item.Properties())));

And then in my main class's constructor this's everything.

IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();

BLOCKS.register(modEventBus);
ITEMS.register(modEventBus);

//MinecraftForge.EVENT_BUS.register(this);

modEventBus.addListener(this::addCreative);
modEventBus.addListener(this::buildContents);

And for reference the aforementioned large_copper_heat_sink.json file:

{
	"parent": "gsr_yatm:block/large_heat_sink",
	"textures": {
		"1": "gsr_yatm:block/large_copper_heat_sink_one",
		"2": "gsr_yatm:block/large_copper_heat_sink_two"
	}
}

And then finally the parent it references:

{
	"credit": "Made with Blockbench",
	"textures": {
		"particle": "#1"
	},
	"elements": [
		{
			"from": [0, 0, 0],
			"to": [16, 4, 16],
			"faces": {
				"north": {"uv": [0, 0, 16, 4], "texture": "#2"},
				"east": {"uv": [0, 0, 16, 4], "texture": "#2"},
				"south": {"uv": [0, 0, 16, 4], "texture": "#2"},
				"west": {"uv": [0, 0, 16, 4], "texture": "#2"},
				"up": {"uv": [0, 0, 16, 16], "texture": "#1"},
				"down": {"uv": [0, 0, 16, 16], "texture": "#1"}
			}
		},
		{
			"from": [4, 4, 4],
			"to": [12, 5, 12],
			"faces": {
				"north": {"uv": [4, 9, 12, 10], "texture": "#1"},
				"east": {"uv": [4, 9, 12, 10], "texture": "#1"},
				"south": {"uv": [4, 9, 12, 10], "texture": "#1"},
				"west": {"uv": [4, 9, 12, 10], "texture": "#1"},
				"up": {"uv": [0, 0, 8, 8], "texture": "#1"},
				"down": {"uv": [0, 0, 8, 8], "texture": "#1"}
			}
		},
		{
			"from": [0, 5, 0],
			"to": [16, 6, 16],
			"faces": {
				"north": {"uv": [0, 6, 16, 7], "texture": "#1"},
				"east": {"uv": [0, 6, 16, 7], "texture": "#1"},
				"south": {"uv": [0, 6, 16, 7], "texture": "#1"},
				"west": {"uv": [0, 6, 16, 7], "texture": "#1"},
				"up": {"uv": [0, 0, 16, 16], "texture": "#1"},
				"down": {"uv": [0, 0, 16, 16], "texture": "#1"}
			}
		},
		{
			"from": [4, 6, 4],
			"to": [12, 7, 12],
			"faces": {
				"north": {"uv": [4, 8, 12, 9], "texture": "#1"},
				"east": {"uv": [4, 8, 12, 9], "texture": "#1"},
				"south": {"uv": [4, 8, 12, 9], "texture": "#1"},
				"west": {"uv": [4, 8, 12, 9], "texture": "#1"},
				"up": {"uv": [0, 0, 8, 8], "texture": "#1"},
				"down": {"uv": [0, 0, 8, 8], "texture": "#1"}
			}
		},
		{
			"from": [0, 7, 0],
			"to": [16, 8, 16],
			"faces": {
				"north": {"uv": [0, 4, 16, 5], "texture": "#1"},
				"east": {"uv": [0, 4, 16, 5], "texture": "#1"},
				"south": {"uv": [0, 4, 16, 5], "texture": "#1"},
				"west": {"uv": [0, 4, 16, 5], "texture": "#1"},
				"up": {"uv": [0, 0, 16, 16], "texture": "#1"},
				"down": {"uv": [0, 0, 16, 16], "texture": "#1"}
			}
		},
		{
			"from": [4, 8, 4],
			"to": [12, 9, 12],
			"faces": {
				"north": {"uv": [4, 7, 12, 8], "texture": "#1"},
				"east": {"uv": [4, 7, 12, 8], "texture": "#1"},
				"south": {"uv": [4, 7, 12, 8], "texture": "#1"},
				"west": {"uv": [4, 7, 12, 8], "texture": "#1"},
				"up": {"uv": [0, 0, 8, 8], "texture": "#1"},
				"down": {"uv": [0, 0, 8, 8], "texture": "#1"}
			}
		},
		{
			"from": [0, 9, 0],
			"to": [16, 10, 16],
			"faces": {
				"north": {"uv": [0, 3, 16, 4], "texture": "#1"},
				"east": {"uv": [0, 3, 16, 4], "texture": "#1"},
				"south": {"uv": [0, 3, 16, 4], "texture": "#1"},
				"west": {"uv": [0, 3, 16, 4], "texture": "#1"},
				"up": {"uv": [0, 0, 16, 16], "rotation": 180, "texture": "#1"},
				"down": {"uv": [0, 0, 16, 16], "rotation": 90, "texture": "#1"}
			}
		},
		{
			"from": [4, 10, 4],
			"to": [12, 11, 12],
			"faces": {
				"north": {"uv": [4, 6, 12, 7], "texture": "#1"},
				"east": {"uv": [4, 6, 12, 7], "texture": "#1"},
				"south": {"uv": [4, 6, 12, 7], "texture": "#1"},
				"west": {"uv": [4, 6, 12, 7], "texture": "#1"},
				"up": {"uv": [0, 0, 8, 8], "texture": "#1"},
				"down": {"uv": [0, 0, 8, 8], "texture": "#1"}
			}
		},
		{
			"from": [0, 11, 0],
			"to": [16, 12, 16],
			"faces": {
				"north": {"uv": [0, 0, 16, 1], "texture": "#1"},
				"east": {"uv": [0, 1, 16, 0], "texture": "#1"},
				"south": {"uv": [0, 0, 16, 1], "texture": "#1"},
				"west": {"uv": [0, 0, 16, 1], "texture": "#1"},
				"up": {"uv": [0, 0, 16, 16], "texture": "#1"},
				"down": {"uv": [0, 0, 16, 16], "texture": "#1"}
			}
		},
		{
			"from": [4, 12, 4],
			"to": [12, 13, 12],
			"faces": {
				"north": {"uv": [4, 5, 12, 6], "texture": "#1"},
				"east": {"uv": [4, 5, 12, 6], "texture": "#1"},
				"south": {"uv": [4, 5, 12, 6], "texture": "#1"},
				"west": {"uv": [4, 5, 12, 6], "texture": "#1"},
				"up": {"uv": [0, 0, 8, 8], "texture": "#1"},
				"down": {"uv": [0, 0, 8, 8], "texture": "#1"}
			}
		},
		{
			"from": [0, 13, 0],
			"to": [16, 14, 16],
			"faces": {
				"north": {"uv": [0, 1, 16, 2], "texture": "#1"},
				"east": {"uv": [0, 1, 16, 2], "texture": "#1"},
				"south": {"uv": [0, 1, 16, 2], "texture": "#1"},
				"west": {"uv": [0, 1, 16, 2], "texture": "#1"},
				"up": {"uv": [0, 0, 16, 16], "rotation": 270, "texture": "#1"},
				"down": {"uv": [0, 0, 16, 16], "rotation": 180, "texture": "#1"}
			}
		},
		{
			"from": [4, 14, 4],
			"to": [12, 15, 12],
			"faces": {
				"north": {"uv": [4, 4, 12, 5], "texture": "#1"},
				"east": {"uv": [4, 4, 12, 5], "texture": "#1"},
				"south": {"uv": [4, 4, 12, 5], "texture": "#1"},
				"west": {"uv": [4, 4, 12, 5], "texture": "#1"},
				"up": {"uv": [0, 0, 8, 8], "texture": "#1"},
				"down": {"uv": [0, 0, 8, 8], "texture": "#1"}
			}
		},
		{
			"from": [0, 15, 0],
			"to": [16, 16, 16],
			"faces": {
				"north": {"uv": [0, 0, 16, 1], "texture": "#1"},
				"east": {"uv": [0, 0, 16, 1], "texture": "#1"},
				"south": {"uv": [0, 0, 16, 1], "texture": "#1"},
				"west": {"uv": [0, 0, 16, 1], "texture": "#1"},
				"up": {"uv": [0, 0, 16, 16], "texture": "#1"},
				"down": {"uv": [0, 0, 16, 16], "texture": "#1"}
			}
		}
	]
}

Any help'd be sincerely appreciated,

GSR

Link to comment
Share on other sites

Don't post code in the forum. Upload enough code to github to reproduce your issue.

 

If the problem isn't obvious from the little information you post in the forums, your question will likely just be ignored.

But if the problem isn't obvious from reading the code on github, we can at least download it and run/debug it for ourselves.

 

e.g. In this case we have no way to validate you have done things correctly if we can't see the real file structure, rather than what you think/say it is.

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Link to comment
Share on other sites

That isn't what I meant by reproducable. Where's the build.gradle, etc?

If you don't make your problem easily accessible, people will eventually just ignore it instead of wasting time keeping having to ask for more information.

 

Anyway, I've never seen a model done that like that.

https://github.com/GSR-Os76/YATM/blob/main/src/main/resources/assets/gsr_yatm/models/block/large_heat_sink.json

Your root model has none of the item transformation stuff, e.g. this is the vanilla root model for most blocks

https://github.com/misode/mcmeta/blob/assets/assets/minecraft/models/block/block.json

 

To be honest, I don't know what it uses if you don't specify that information?

I would guess if you add "minecraft:block/block" as the parent of that large_heat_sink model it would fix things?

I would also bet your run/logs/debug.log has a lot of warnings. Especially since the block has no blockstates file.

 

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Link to comment
Share on other sites

Adding the "minecraft:block/block" as the parent to the large_heat_sink.json model fixes how it renders in the players hand and inventory slots to be more so consistent with other blocks, but it still doesn't render in the world to any extent. Still good to know though, still helpful improvement.

In fact cutting out the middle person all together doesn't fix anything either, nor does copying a working block that's from minecraft's block json file as the large_copper_heat_sink block model, they'll only work for the BlockItem. I tried both among many other things throughout yesterday, along with reading all the documentation I could find, yet I have no clue. And I can't find other people reporting it happening for forge 1.19.3 - 44.1.0 either, so I'd suspect it's something to do with my set up.

 

I've uploaded the build.gradle file, as well as several others. To be entirely honest I don't know what they actually mean/represent/do, I've been doing this for roughly five days and haven't researched them yet.

Your patience and contribution of your time is very much appreciated.

Link to comment
Share on other sites

38 minutes ago, warjort said:

I would also bet your run/logs/debug.log has a lot of warnings. Especially since the block has no blockstates file.

 

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Link to comment
Share on other sites

Quote

[17May2023 17:35:06.737] [Worker-Main-2/WARN] [net.minecraft.client.resources.model.ModelBakery/]: Exception loading blockstate definition: 'gsr_yatm:blockstates/large_copper_heat_sink.json' missing model for variant: 'gsr_yatm:large_copper_heat_sink#'

 

  • Like 1

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I have a problem, I am trying to put two different effects to two different armors but when I run it only the emerald armor effect works. This is the code public class ModArmorItem extends ArmorItem{ private static final Map<ArmorMaterial, MobEffectInstance> MATERIAL_TO_EFFECT_MAP = (new ImmutableMap.Builder<ArmorMaterial, MobEffectInstance>()) .put(ModArmorMaterials.EMERALD, new MobEffectInstance(MobEffects.HERO_OF_THE_VILLAGE,200, 1,false,false, true)) .put(ModArmorMaterials.OBSIDIAN, new MobEffectInstance(MobEffects.FIRE_RESISTANCE,200, 1,false,false, true)).build(); public ModArmorItem(ArmorMaterial pMaterial, Type pType, Properties pProperties) { super(pMaterial, pType, pProperties); } @Override public void onArmorTick(ItemStack stack, Level world, Player player){ if (!world.isClientSide()) { if (hasFullSuitOfArmorOn(player)) { evaluateArmorEffects(player); } } } private void evaluateArmorEffects(Player player) { for (Map.Entry<ArmorMaterial,MobEffectInstance> entry : MATERIAL_TO_EFFECT_MAP.entrySet()){ ArmorMaterial mapArmorMaterial = entry.getKey(); MobEffectInstance mapStatusEffect = entry.getValue(); if (hasCorrectArmorOn(mapArmorMaterial, player)) { addStatusEffectForMaterial(player, mapArmorMaterial, mapStatusEffect); } } } private void addStatusEffectForMaterial(Player player, ArmorMaterial mapArmorMaterial, MobEffectInstance mapStatusEffect) { boolean hasPlayerEffect = player.hasEffect(mapStatusEffect.getEffect()); if (hasCorrectArmorOn(mapArmorMaterial, player) && !hasPlayerEffect) { player.addEffect(new MobEffectInstance(mapStatusEffect)); } } private boolean hasCorrectArmorOn(ArmorMaterial material, Player player) { for (ItemStack armorStack : player.getInventory().armor){ if (!(armorStack.getItem() instanceof ArmorItem)) { return false; } } ArmorItem helmet = ((ArmorItem)player.getInventory().getArmor(3).getItem()); ArmorItem breastplace = ((ArmorItem)player.getInventory().getArmor(2).getItem()); ArmorItem leggins = ((ArmorItem)player.getInventory().getArmor(1).getItem()); ArmorItem boots = ((ArmorItem)player.getInventory().getArmor(0).getItem()); return helmet.getMaterial() == material && breastplace.getMaterial() == material && leggins.getMaterial() == material && boots.getMaterial() == material; } private boolean hasFullSuitOfArmorOn(Player player){ ItemStack helmet = player.getInventory().getArmor(3); ItemStack breastplace = player.getInventory().getArmor(2); ItemStack leggins = player.getInventory().getArmor(1); ItemStack boots = player.getInventory().getArmor(0); return !helmet.isEmpty() && !breastplace.isEmpty() && !leggins.isEmpty() && !boots.isEmpty(); } } Also when I place two effects on the same armor, the game crashes. Here is the crash file. The code is the same, only this part is different   private static final Map<ArmorMaterial, MobEffectInstance> MATERIAL_TO_EFFECT_MAP = (new ImmutableMap.Builder<ArmorMaterial, MobEffectInstance>()) .put(ModArmorMaterials.EMERALD, new MobEffectInstance(MobEffects.HERO_OF_THE_VILLAGE,200, 1,false,false, true)) .put(ModArmorMaterials.EMERALD, new MobEffectInstance(MobEffects.FIRE_RESISTANCE,200, 1,false,false, true)).build(); I hope you guys can help me. Thanks.
    • I removed all related embeddium and oculus mods, i just tested it by disconnecting and the error happened again. heres the report https://pastebin.com/1kcR5wAt   EDIT: i tried removing xaeros and also smoothboot thinking there may be an issue there, nothing, heres that report too. https://pastebin.com/zQS7i9rM
    • Hi, I need suggestions. I am a beginner in Minecraft Modding. I would like to apply custom effects to some armors, something like: more chance to drop seeds, change zombie awareness, drop more pieces of wood when chopping logs, and things like that. How would you recommend me to do it, is there any library that has something similar and which ones would you recommend me?.
    • "downloading minecraft server failed, invalid Checksum. try again, or manually place server.jar to skip download"    
    • You have to create an Entity class called PlayerPart and use multiple of them to make the different parts of the player. See EnderDragonPart.java source code. The green hitboxes of the dragon are all EnderDragonParts
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.