-
Custom Mob Spawns with Nametag
I created a custom mob but it spawns with a nametag over its head automatically. The name tag is the path of my entity and I can specify and change it in the lang file but I can't figure out how to get rid of the name tag.
-
[1.15.2]OBJ models for entities
Post your code
-
Issue with entity renderer, game crashes when I try spawning custom entity.
I have tried to add a custom entity to my mod but when I run the mod I get this error: No renderer registered for bigbadboybob2:caveman_entity When I then try to spawn this entity main game crashes. Here is my code for the renderer: package lucas.MoeMobsMod.client.render; import lucas.MoeMobsMod.MainMod; import lucas.MoeMobsMod.client.models.CavemanModel; import lucas.MoeMobsMod.entities.Caveman; import net.minecraft.client.renderer.entity.EntityRenderer; import net.minecraft.client.renderer.entity.EntityRendererManager; import net.minecraft.client.renderer.entity.LivingRenderer; import net.minecraft.util.ResourceLocation; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.fml.client.registry.IRenderFactory; @OnlyIn(Dist.CLIENT) public class CavemanEntityRender extends LivingRenderer<Caveman, CavemanModel> { public CavemanEntityRender(EntityRendererManager manager) { super(manager, new CavemanModel(), 0f); } @Override public ResourceLocation getEntityTexture(Caveman entity) { return MainMod.Location("textures/entity/caveman_entity.png"); } public static class RenderFactory implements IRenderFactory<Caveman> { @Override public EntityRenderer<? super Caveman> createRenderFor(EntityRendererManager manager) { return new CavemanEntityRender(manager); } } } and here is my code for the render registry: package lucas.MoeMobsMod.client.render; import lucas.MoeMobsMod.lists.EntityList; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.fml.client.registry.RenderingRegistry; @OnlyIn(Dist.CLIENT) public class CavemanEntityRenderRegistry { public static void registerEntityRenders() { RenderingRegistry.registerEntityRenderingHandler(EntityList.caveman_entity, new CavemanEntityRender.RenderFactory()); } }
-
Block texture not loading when placed
Updated forge. Worked.
-
Block texture not loading when placed
Thanks everyone for replying I have looked over my directories multiple times and didn't see anything wrong but in case there is anything I'm missing, here is a screenshot of my directory:
-
Block texture not loading when placed
this is my blockstates file: { "variants": { "": { "model": "bigbadboybob1:block/tutorial_block" } } }
-
Block texture not loading when placed
I'm new to modding and just tried to create my first block. The block showed up successfully in my inventory as an item but when I placed the block it shows up as the black and magenta missing texture: I don't understand how this is possible because my models/item/tutorial_block.json file just redirects to the models/block/tutorial_block.json file like this: { "parent": "bigbadboybob1:block/tutorial_block" } Here is my models/block/tutorial_block.json file: { "parent": "block/cube_all", "textures": { "all": "bigbadboybob1:block/tutorial_block" } } Here is my main java file for reference: package lucas.tutorialmod; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import lucas.tutorialmod.lists.BlockList; import lucas.tutorialmod.lists.ItemList; import lucas.tutorialmod.lists.ToolMaterialList; import net.minecraft.block.Block; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.item.AxeItem; import net.minecraft.item.BlockItem; import net.minecraft.item.HoeItem; import net.minecraft.item.Item; import net.minecraft.item.ItemGroup; import net.minecraft.item.PickaxeItem; import net.minecraft.item.ShovelItem; import net.minecraft.item.SwordItem; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; @Mod("bigbadboybob1") public class TutorialMod { public static TutorialMod instance; public static final String modid = "bigbadboybob1"; private static final Logger logger = LogManager.getLogger(modid); public static final ItemGroup tutorial = new TutorialItemGroup(); public TutorialMod() { instance = this; FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::clientRegistries); MinecraftForge.EVENT_BUS.register(this); } private void setup(final FMLCommonSetupEvent event) { logger.info("Setup method registered."); } private void clientRegistries(final FMLClientSetupEvent event) { logger.info("Client method registered."); } @Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD) public static class RegistryEvents{ @SubscribeEvent public static void registerItems(final RegistryEvent.Register<Item> event) { event.getRegistry().registerAll ( ItemList.tutorial_item = new Item(new Item.Properties().group(tutorial)).setRegistryName(Location("tutorial_item")), ItemList.tutorial_block = new BlockItem(BlockList.tutorial_block, new Item.Properties().group(tutorial)).setRegistryName(BlockList.tutorial_block.getRegistryName()) /* ItemList.tutorial_axe = new AxeItem(ToolMaterialList.tutorial, -10.0f, 2.0f, new Item.Properties().group(tutorial)).setRegistryName(Location("tutorial_axe")), ItemList.tutorial_hoe = new HoeItem(ToolMaterialList.tutorial, -40.0f, new Item.Properties().group(tutorial)).setRegistryName(Location("tutorial_hoe")), ItemList.tutorial_pickaxe = new PickaxeItem(ToolMaterialList.tutorial, -40, 2.0f, new Item.Properties().group(tutorial)).setRegistryName(Location("tutorial_pickaxe")), ItemList.tutorial_shovel = new ShovelItem(ToolMaterialList.tutorial, -40.0f, 2.0f, new Item.Properties().group(tutorial)).setRegistryName(Location("tutorial_axe")), ItemList.tutorial_sword = new SwordItem(ToolMaterialList.tutorial, 0, 2.0f, new Item.Properties().group(tutorial)).setRegistryName(Location("tutorial_axe")) */ ); logger.info("Items registered"); } @SubscribeEvent public static void registerBlocks(final RegistryEvent.Register<Block> event) { event.getRegistry().registerAll ( BlockList.tutorial_block = new Block(Block.Properties.create(Material.IRON).hardnessAndResistance(2.0f, 3.0f).lightValue(5).sound(SoundType.SNOW)).setRegistryName(Location("tutorial_block")) ); logger.info("Items registered"); } private static ResourceLocation Location(String name) { return new ResourceLocation(modid, name); } } } EDIT: Got this in the console when launching the mod: [m[33m[14:25:09] [Server-Worker-3/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: bigbadboybob1:blockstates/tutorial_block.json: java.io.FileNotFoundException: bigbadboybob1:blockstates/tutorial_block.json [m[33m[14:25:09] [Server-Worker-3/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'bigbadboybob1:blockstates/tutorial_block.json' missing model for variant: 'bigbadboybob1:tutorial_block#' This is my blockstates file: { "variants": { "": { "model": "bigbadboybob1:block/tutorial_block" } } }
IPS spam blocked by CleanTalk.