So I want to make a custom mod for my modpack, how would I go about making a mod with only events no blocks or items.
What kind of events? If you don't want blocks or items, then you simply do not add the class to the MainRegistry and make the classes for the blocks or items.
From my understanding the game should do it by itself, but I may be wrong
from looks of things you need to call the proxy register renderers method in Main init method and that should then call the modItems register ItemRenderer
I'm on tutorial 15a and I got a few errors trying to import some things
The error for "Class": Class is a raw type. References to generic type Class<T> should be parameterized
The error for "instance":instance cannot be resolved or is not a field
public static CreativeTabs tabPlastic = new PlasticTab(CreativeTabs.getNextID(),"tabPlastic");
It is the exact same from the tutorial, except with the name changes. Eclipse give the error: Type mismatch. Cannot convert from PlasticTab to CreativeTabs. Nothing else is giving errors.
Thanks for the tutorials! I've had two problems so far:
Tutorial 5 (items): the client crashed until I added "Exodus.registerItemRenderer();" in the init method of main. I believe that's not written on the tutorial (on preInit didn't work, it had to be on init)
Tutorial 6 (blocks): the block has no texture. While the tutorial ends with giving it texture, I don't know where to place the texture image (nor do I know what type of image to use, but I can google that "easily") and I suppose I have to include "Exodus.registerBlockRenderer();" on init.
And another question: how do you remember all the setup for each mod you make? It's huge.
public static CreativeTabs tabPlastic = new PlasticTab(CreativeTabs.getNextID(),"tabPlastic");
It is the exact same from the tutorial, except with the name changes. Eclipse give the error: Type mismatch. Cannot convert from PlasticTab to CreativeTabs. Nothing else is giving errors.
[18:15:11] [Client thread/WARN]: Failed to load texture: cocorj07:models/armor/magic_layer1.png
java.io.FileNotFoundException: cocorj07:models/armor/magic_layer1.png
at net.minecraft.client.resources.FallbackResourceManager.getResource(FallbackResourceManager.java:65) ~[FallbackResourceManager.class:?]
at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:67) ~[SimpleReloadableResourceManager.class:?]
at net.minecraft.client.renderer.texture.SimpleTexture.loadTexture(SimpleTexture.java:35) ~[SimpleTexture.class:?]
at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:89) [TextureManager.class:?]
at net.minecraft.client.renderer.texture.TextureManager.bindTexture(TextureManager.java:45) [TextureManager.class:?]
at net.minecraft.client.renderer.entity.Render.bindTexture(Render.java:60) [Render.class:?]
at net.minecraft.client.renderer.entity.RenderPlayer.shouldRenderPass(RenderPlayer.java:70) [RenderPlayer.class:?]
at net.minecraft.client.renderer.entity.RenderPlayer.shouldRenderPass(RenderPlayer.java:517) [RenderPlayer.class:?]
at net.minecraft.client.renderer.entity.RendererLivingEntity.doRender(RendererLivingEntity.java:173) [RendererLivingEntity.class:?]
at net.minecraft.client.renderer.entity.RenderPlayer.doRender(RenderPlayer.java:167) [RenderPlayer.class:?]
at net.minecraft.client.renderer.entity.RenderPlayer.doRender(RenderPlayer.java:565) [RenderPlayer.class:?]
at net.minecraft.client.renderer.entity.RenderManager.func_147939_a(RenderManager.java:300) [RenderManager.class:?]
at net.minecraft.client.renderer.entity.RenderManager.renderEntityWithPosYaw(RenderManager.java:283) [RenderManager.class:?]
at net.minecraft.client.gui.inventory.GuiInventory.func_147046_a(GuiInventory.java:112) [GuiInventory.class:?]
at net.minecraft.client.gui.inventory.GuiContainerCreative.drawGuiContainerBackgroundLayer(GuiContainerCreative.java:839) [GuiContainerCreative.class:?]
at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:93) [GuiContainer.class:?]
at net.minecraft.client.renderer.InventoryEffectRenderer.drawScreen(InventoryEffectRenderer.java:44) [InventoryEffectRenderer.class:?]
at net.minecraft.client.gui.inventory.GuiContainerCreative.drawScreen(GuiContainerCreative.java:673) [GuiContainerCreative.class:?]
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1137) [EntityRenderer.class:?]
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1067) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:962) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:164) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_45]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_45]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_45]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_45]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.11.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?]
at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?]
at GradleStart.main(Unknown Source) [start/:?]
I have followed the tutorial exactly and my armor texture won't show up, it is located in:
--a bunch of folders from my desktop--\forge-1.7.10-10.13.3.1403-1.7.10-src\src\main\resources\cocorj07\models\armor
What kind of events? If you don't want blocks or items, then you simply do not add the class to the MainRegistry and make the classes for the blocks or items.
Thank you so much. It all makes perfect sense.
Mainly item pickup events,
then just make and register a class for custom events and use forge EntityItemPickupEvent event.
@SubscribeEvent
public void onPickup(EntityItemPickupEvent event){
}
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumHow could you not? I'm not sure if you know how this works.
I must have missed something, because I don't know how to run Minecraft from eclipse. I click "Run" and I get this message:
"The selection cannot be launched, and there are no recent launches."
Thank you! This worked great.
As for your problem, I would double check in eclipse for errors and make sure your most recent changes have been saved.
it doesn't look like your registering an icon or renderer for your item at all only code you call in your main class is to register the item
Edit - or am i wrong and this should be called by main game loop so long as item is registered??
from looks of things you need to call the proxy register renderers method in Main init method and that should then call the modItems register ItemRenderer
^^^ My post was missed
Post your code.
Under the class "ModTabs", I put this code:
public static CreativeTabs tabPlastic = new PlasticTab(CreativeTabs.getNextID(),"tabPlastic");
It is the exact same from the tutorial, except with the name changes. Eclipse give the error: Type mismatch. Cannot convert from PlasticTab to CreativeTabs. Nothing else is giving errors.
EDIT: Github here: https://github.com/erindalc/ErindalTestMod
have you tried putting a line calling client proxy to register renderers in Main init method?
should be called - proxy.registerRenderers();
Edit - yeah that's right should be in FMLInitializationEvent as you want it to run after all blocks/items are registered
package com.gmail.brockstaryt.legit.init;
import net.minecraft.entity.EntityList;
import com.gmail.brockstaryt.legit.Legit;
import com.gmail.brockstaryt.legit.help.LogHelper;
import cpw.mods.fml.common.registry.EntityRegistry;
public class ModEntities {
static int i;
static int startEntityID;
public static void init()
{
}
public static void registerModProjectile(Class entityClass, String name)
{
EntityRegistry.registerModEntity(entityClass, name, ++startEntityID, Legit.instance, 64, 10, true);
LogHelper.info("Registering mod projectile " + name + " with ID = " + startEntityID);
}
public static void registerModEntity(Class entityClass, String name)
{
EntityRegistry.registerModEntity(entityClass, name, ++startEntityID, Legit.instance, 80, 3, false);
LogHelper.info("Registering mod entity " + name + " with ID = " + startEntityID);
}
public static void registerModEntityEgg(Class entityClass, String name, int primary, int secondary)
{
registerModEntity(entityClass, name);
if (i == 0)
{
registerSpawnEgg(name, primary, secondary);
++i;
}
}
public static void registerSpawnEgg(String name, int primary, int secondary)
{
}
public static int getUniqueEntityId()
{
do
{
startEntityID++;
}
while (EntityList.getStringFromID(startEntityID) != null);
return startEntityID;
}
}
It's just a warning. Suppress it using the annotation (hover over, and one of the available fixes should be to suppress the warning).
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumIs your class called Exodus?
Still can't figure this problem. I'm totally stumped as to what's wrong.
EDIT: looking at some other tutorials solved it.
public ItemMagicArmor(ArmorMaterial material, int ArmorType, String name)
{
super(material, 0, ArmorType);
setUnlocalizedName(name);
setTextureName(Reference.MODID + ":" + getUnlocalizedName().substring(5));
setCreativeTab(ModTabs.tabMindstormMagiciansMod);
}
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)
{
if (stack.getItem() == (ModArmory.magicHelm) || stack.getItem() == (ModArmory.magicPlate) || stack.getItem() == (ModArmory.magicBoots))
{
return Reference.MODID + ":models/armor/magic_layer1.png";
}
else if (stack.getItem() == (ModArmory.magicPants))
{
return Reference.MODID + ":models/armor/magic_layer2.png";
}
else
{
return null;
}
}
}
Error I get in the console:
[18:15:11] [Client thread/WARN]: Failed to load texture: cocorj07:models/armor/magic_layer1.png
java.io.FileNotFoundException: cocorj07:models/armor/magic_layer1.png
at net.minecraft.client.resources.FallbackResourceManager.getResource(FallbackResourceManager.java:65) ~[FallbackResourceManager.class:?]
at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:67) ~[SimpleReloadableResourceManager.class:?]
at net.minecraft.client.renderer.texture.SimpleTexture.loadTexture(SimpleTexture.java:35) ~[SimpleTexture.class:?]
at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:89) [TextureManager.class:?]
at net.minecraft.client.renderer.texture.TextureManager.bindTexture(TextureManager.java:45) [TextureManager.class:?]
at net.minecraft.client.renderer.entity.Render.bindTexture(Render.java:60) [Render.class:?]
at net.minecraft.client.renderer.entity.RenderPlayer.shouldRenderPass(RenderPlayer.java:70) [RenderPlayer.class:?]
at net.minecraft.client.renderer.entity.RenderPlayer.shouldRenderPass(RenderPlayer.java:517) [RenderPlayer.class:?]
at net.minecraft.client.renderer.entity.RendererLivingEntity.doRender(RendererLivingEntity.java:173) [RendererLivingEntity.class:?]
at net.minecraft.client.renderer.entity.RenderPlayer.doRender(RenderPlayer.java:167) [RenderPlayer.class:?]
at net.minecraft.client.renderer.entity.RenderPlayer.doRender(RenderPlayer.java:565) [RenderPlayer.class:?]
at net.minecraft.client.renderer.entity.RenderManager.func_147939_a(RenderManager.java:300) [RenderManager.class:?]
at net.minecraft.client.renderer.entity.RenderManager.renderEntityWithPosYaw(RenderManager.java:283) [RenderManager.class:?]
at net.minecraft.client.gui.inventory.GuiInventory.func_147046_a(GuiInventory.java:112) [GuiInventory.class:?]
at net.minecraft.client.gui.inventory.GuiContainerCreative.drawGuiContainerBackgroundLayer(GuiContainerCreative.java:839) [GuiContainerCreative.class:?]
at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:93) [GuiContainer.class:?]
at net.minecraft.client.renderer.InventoryEffectRenderer.drawScreen(InventoryEffectRenderer.java:44) [InventoryEffectRenderer.class:?]
at net.minecraft.client.gui.inventory.GuiContainerCreative.drawScreen(GuiContainerCreative.java:673) [GuiContainerCreative.class:?]
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1137) [EntityRenderer.class:?]
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1067) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:962) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:164) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_45]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_45]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_45]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_45]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.11.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?]
at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?]
at GradleStart.main(Unknown Source) [start/:?]
I have followed the tutorial exactly and my armor texture won't show up, it is located in:
--a bunch of folders from my desktop--\forge-1.7.10-10.13.3.1403-1.7.10-src\src\main\resources\cocorj07\models\armor
Is my location wrong or is it my code?
Your missing assets dir after resources and before cocorj07