Jump to content

Recommended Posts

Posted

Hello, I've been trying to add a mob to the game and have been able to get an egg that can spawn my new mob. However, it comes out like the picture below instead of what it should be, a bee. What is wrong with my code? Below I have posted everything I got for you.

 

P3PtNmh.png

 

Main Class:

package kmccmk9.witchcraft;

import java.awt.Color;

import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityEggInfo;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.src.ModLoader;
import net.minecraft.world.biome.BiomeGenBase;

import kmccmk9.witchcraft.CommonProxy;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;

@Mod(modid="witchcraft", name="WitchCraft", version="0.0.1")
@NetworkMod(clientSideRequired=true, serverSideRequired=false)

public class WitchCraft {
// The instance of your mod that Forge uses.
    @Instance("WitchCraft")
    public static WitchCraft instance;
    
    // Says where the client and server 'proxy' code is loaded.
    @SidedProxy(clientSide="kmccmk9.witchcraft.client.ClientProxy", serverSide="kmccmk9.witchcraft.CommonProxy")
    public static CommonProxy proxy;
    
    @EventHandler
    public void preInit(FMLPreInitializationEvent event) {
            // Stub Method
    }
    
    @EventHandler
    public void load(FMLInitializationEvent event) {
    	int background = (Color.YELLOW.getRed() << 16) + (Color.YELLOW.getGreen() <<  + Color.YELLOW.getBlue();
    	int foreground = (Color.BLACK.getRed() << 16) + (Color.BLACK.getGreen() <<  + Color.BLACK.getBlue();
    	int id = ModLoader.getUniqueEntityId();
    	EntityRegistry.registerModEntity(EntityBee.class, "Bee", 1, this, 80, 5, true);
    	ModLoader.registerEntityID(EntityBee.class, "Bee",  id, background, foreground);
    	EntityRegistry.addSpawn(EntityBee.class, 7, 1, 4, EnumCreatureType.monster, BiomeGenBase.beach, BiomeGenBase.forest, BiomeGenBase.jungle, BiomeGenBase.plains);
    	LanguageRegistry.instance().addStringLocalization("entity.witchcraft.Bee.name", "Bee");
    	
    	EntityList.IDtoClassMapping.put(id, EntityBee.class);
    	EntityList.entityEggs.put(id, new EntityEggInfo(id, background, foreground));
    	
    }
    
    @EventHandler
    public void postInit(FMLPostInitializationEvent event) {
            // Stub Method
    }
}

 

EntityClass:

package kmccmk9.witchcraft;

import net.minecraft.client.renderer.EntityRenderer;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.item.Item;
import net.minecraft.world.World;
import net.minecraft.src.*;

public class EntityBee extends EntityLiving {

public EntityBee(World par1World) {
	super(par1World);
	this.getNavigator().setAvoidsWater(true);
	this.setSize(0.5F, 0.5F);
	this.setEntityHealth(15F);
	this.setAIMoveSpeed(3F);
}

protected int getDropItemId()
    {
        return Item.porkRaw.itemID;
    }

public String getTexture() {
	return "textures/bee.png";
}

}

 

ModelClass:

package kmccmk9.witchcraft.client;

import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;




public class ModelBee extends ModelBase
{
  //fields
    ModelRenderer BeeBody;
    ModelRenderer BeeHead;
    ModelRenderer ant1;
    ModelRenderer ant2;
    ModelRenderer wing2;
    ModelRenderer wing1;
  
  public ModelBee()
  {
//constructor:
ant1 = new ModelRenderer(this, 0, 0);
ant1.mirror = true;
ant1.addBox(2F, 4F, -1F, 1, 4, 1);
ant1.rotateAngleZ = 0.17453292519943295F;

ant2 = new ModelRenderer(this, 41, 5);
ant2.mirror = true;
ant2.addBox(2F, 3F, -1F, 1, 4, 1);
ant2.rotateAngleZ = 6.1086523819801535F;

BeeBody = new ModelRenderer(this, 0, 0);
BeeBody.mirror = true;
BeeBody.addBox(0F, 0F, 0F, 5, 4, ;

BeeHead = new ModelRenderer(this, 19, 2);
BeeHead.mirror = true;
BeeHead.addBox(0F, 0F, 0F, 3, 3, 2);
//BeeHead.setPosition(1F, 1F, -2F);

wing1 = new ModelRenderer(this, 31, 1);
wing1.mirror = true;
wing1.addBox(5F, 1F, 2F, 4, 1, 3);
wing1.rotateAngleZ = 6.126105674500097F;

wing2 = new ModelRenderer(this, 31, 5);
wing2.mirror = true;
wing2.addBox(-4F, 2F, 2F, 4, 1, 3);
wing2.rotateAngleZ = 0.15707963267948966F;
  }
  
  public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
  {
    	//render:
ant1.render(f5);
ant2.render(f5);
BeeBody.render(f5);
BeeHead.render(f5);
wing1.render(f5);
wing2.render(f5);
  }
  
  private void setRotation(ModelRenderer model, float x, float y, float z)
  {
    model.rotateAngleX = x;
    model.rotateAngleY = y;
    model.rotateAngleZ = z;
  }
  
  public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity)
  {
    super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
  }
}

 

RendererClass:

package kmccmk9.witchcraft;

import kmccmk9.witchcraft.client.ModelBee;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.EntityRenderer;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;

public class RendererBee extends RenderLiving {
protected ModelBee model;
private static final ResourceLocation field_110775_a = new ResourceLocation("textures/bee.png");
public RendererBee(ModelBee par1ModelBase, float par2) {
	super(par1ModelBase, par2);
	model = (ModelBee)par1ModelBase;
}
@Override
protected ResourceLocation func_110775_a(Entity entity) {
	// TODO Auto-generated method stub
	return null;
}


}

 

Any help is greatly appreciated!

Posted

private static final ResourceLocation field_110775_a = new ResourceLocation("textures/bee.png");
@Override
protected ResourceLocation func_110775_a(Entity entity) {
	// TODO Auto-generated method stub
	return null;
}

*facepalm*

Why do you think that should work ?

Posted
  On 8/30/2013 at 6:24 AM, GotoLink said:

private static final ResourceLocation field_110775_a = new ResourceLocation("textures/bee.png");
@Override
protected ResourceLocation func_110775_a(Entity entity) {
	// TODO Auto-generated method stub
	return null;
}

*facepalm*

Why do you think that should work ?

 

Ya I had a feeling it may be in that class. But I keep trying to follow different tutorials for different forge versions since no one seems to have one for 1.6.2 as of yet. Okay so what would I need to return then?

Posted
  On 8/30/2013 at 2:37 PM, GotoLink said:

Your ResourceLocation of course ! that is what the method asks for !

And give the right texture path too...

 

Okay I changed it and I got this, which seems to still be messed up. But, that is where my texture is?

kdqMmvX.png

Posted
  On 8/30/2013 at 4:12 PM, GotoLink said:

I don't recall Minecraft having a bee texture.  :P

Look for "texture" threads, the proper use of ResourceLocation would be explained.

 

Ok I'll check it out cause the tutorials explained that the way I wrote it, would be the root of the mod folder, then textures and then bee.png.

Posted
  On 8/30/2013 at 4:12 PM, GotoLink said:

I don't recall Minecraft having a bee texture.  :P

Look for "texture" threads, the proper use of ResourceLocation would be explained.

 

Even with the wrong texture path, isn't my model messed up?

Posted
  On 8/31/2013 at 5:06 PM, hydroflame said:

#RenderingRegistry

 

Great thanks. I was able to get the resuilt below. Okay, now the model seems to be upside down. The texture problem, I have to figure out still.

 

7IcEWbd.png

 

Is there something I can do with the mirror part of the model code? What I"m shooting for is like the below image.

 

0gzyQIl.png

Posted

The way that resource locations are done is defaulted to the vanilla minecraft assets folder

you need to change it to so it's directed towards yours

 

for instance, with mine it's

    private static final ResourceLocation field_110890_f = new ResourceLocation("jnosh_advzelda", "textures/entity/chu.png");

 

as the folder structure goes

 

"assets" folder > "jnosh_advzelda" folder > "textures" folder > "entity" folder > "chu.png"

assets/jnosh_advzelda/textures/entity/chu

 

you need to do yours in a similar way, but using your own folders (obviously)

Posted
  On 8/31/2013 at 10:26 PM, Jacknoshima said:

The way that resource locations are done is defaulted to the vanilla minecraft assets folder

you need to change it to so it's directed towards yours

 

for instance, with mine it's

    private static final ResourceLocation field_110890_f = new ResourceLocation("jnosh_advzelda", "textures/entity/chu.png");

 

as the folder structure goes

 

"assets" folder > "jnosh_advzelda" folder > "textures" folder > "entity" folder > "chu.png"

assets/jnosh_advzelda/textures/entity/chu

 

you need to do yours in a similar way, but using your own folders (obviously)

 

So textures are no longer placed within your mod folder?

Posted

no, if you're working in Eclipse, they're placed in forge/mcp/src/minecraft/assets

mine is

forge/mcp/src/minecraft/assets/jnosh_advzelda/textures/entity/chu.png

at least, that's the way that I've seen them all set up since 1.6.1 arrived

 

you might wanna invest some time into looking up how to update from 1.5.2 to 1.6.x if you've still got things set up the old way

Posted
  On 8/31/2013 at 10:48 PM, Jacknoshima said:

no, if you're working in Eclipse, they're placed in forge/mcp/src/minecraft/assets

mine is

forge/mcp/src/minecraft/assets/jnosh_advzelda/textures/entity/chu.png

at least, that's the way that I've seen them all set up since 1.6.1 arrived

 

you might wanna invest some time into looking up how to update from 1.5.2 to 1.6.x if you've still got things set up the old way

 

Okay thanks. Also, following another mod I explored, it was done like so kmccmk9/witchCraft/assets/minecraft/textures/entities/file

Posted
  On 8/31/2013 at 10:48 PM, Jacknoshima said:

no, if you're working in Eclipse, they're placed in forge/mcp/src/minecraft/assets

mine is

forge/mcp/src/minecraft/assets/jnosh_advzelda/textures/entity/chu.png

at least, that's the way that I've seen them all set up since 1.6.1 arrived

 

you might wanna invest some time into looking up how to update from 1.5.2 to 1.6.x if you've still got things set up the old way

 

OMG thank you I finally got it! Now do you have any idea what's wrong with my model?

Posted

At a guess I'd say that it's because there isn't really alot in your render file atm, so it might not be connecting the render and entity to the model

 

erm... I'd suggest taking a look at the bat render file

it's probably the closest you're gunna get to a bee in vanilla

 

it could be this

 

    public void func_82443_a(EntityBat par1EntityBat, double par2, double par4, double par6, float par8, float par9)
    {
        int i = ((ModelBat)this.mainModel).getBatSize();

        if (i != this.renderedBatSize)
        {
            this.renderedBatSize = i;
            this.mainModel = new ModelBat();
        }

        super.doRenderLiving(par1EntityBat, par2, par4, par6, par8, par9);
    }

 

so try

 

    public void func_82443_a(EntityBee par1EntityBat, double par2, double par4, double par6, float par8, float par9)
    {
        int i = ((ModelBee)this.mainModel);

        this.mainModel = new ModelBee();

        super.doRenderLiving(par1EntityBat, par2, par4, par6, par8, par9);
    }

 

however, that is just a guess

exploring the render files would be a better option

and there are some 1.6.2 entity tutorials out there that may be a better help than me

Posted

the correct texture calling would be for example ("foldername:textures/mob/bee.png")

 

what this means is that bee.png is located in    ("assets/foldername/textures/mob/bee.png")\

 

for a normal icon texture the calling would be different for example a normal icon texture would be ("foldername:icon")

which means the icon would be in ("assets/foldername/textures/[blocks][items]/icon.png")

 

I hope this helps

if (You.likescoding == false){
      You.goaway;
}

Posted
  On 8/31/2013 at 11:21 PM, Jacknoshima said:

At a guess I'd say that it's because there isn't really alot in your render file atm, so it might not be connecting the render and entity to the model

 

erm... I'd suggest taking a look at the bat render file

it's probably the closest you're gunna get to a bee in vanilla

 

it could be this

 

    public void func_82443_a(EntityBat par1EntityBat, double par2, double par4, double par6, float par8, float par9)
    {
        int i = ((ModelBat)this.mainModel).getBatSize();

        if (i != this.renderedBatSize)
        {
            this.renderedBatSize = i;
            this.mainModel = new ModelBat();
        }

        super.doRenderLiving(par1EntityBat, par2, par4, par6, par8, par9);
    }

 

so try

 

    public void func_82443_a(EntityBee par1EntityBat, double par2, double par4, double par6, float par8, float par9)
    {
        int i = ((ModelBee)this.mainModel);

        this.mainModel = new ModelBee();

        super.doRenderLiving(par1EntityBat, par2, par4, par6, par8, par9);
    }

 

however, that is just a guess

exploring the render files would be a better option

and there are some 1.6.2 entity tutorials out there that may be a better help than me

 

  Quote

the correct texture calling would be for example ("foldername:textures/mob/bee.png")

 

what this means is that bee.png is located in    ("assets/foldername/textures/mob/bee.png")\

 

for a normal icon texture the calling would be different for example a normal icon texture would be ("foldername:icon")

which means the icon would be in ("assets/foldername/textures/[blocks][items]/icon.png")

 

I hope this helps

 

Ok well from what I gathered, what's messed up is the beehead. Nothing else. But if you look at my model class you 'll see I had to comment out a setPosition line. I think that is the problem. But setPosition is valid so I had to comment it. Otherwise everything is right, the head is just inside the body.

Posted
  On 9/1/2013 at 12:29 AM, GotoLink said:

Then try to find a modeling software that works.

 

I tried both Techne and FMCModeller. The Bee Head is just stick inside the body, if anyone knows how to modify the addbox line for the bee head so that it shows in the right spot...?

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

    • 🌍 TITLE:   Herobrine vs Null – Rise of Prime   > “Rewrite Minecraft history. Witness the rise… and the fall.”         ---   🧩 MOD VERSION:   Minecraft Forge 1.20.1   Built with MCreator   Ultra-cinematic style, custom mobs, weapons, quests, effects, emotional cutscenes       ---   📖 FULL STORY (Final Draft):   ⚔️ ACT 1: Alex’s Death – The Beginning of Darkness   Peaceful world. Alex and Steve explore a new cave.   Suddenly, Null appears from the shadows, corrupts the land, and strikes Alex with a void blade.   A powerful cinematic cutscene plays. Alex dies in Steve’s arms.   Steve collapses crying, lightning and rain begin, music swells.       ---   ⚔️ ACT 2: Broken and Angry – The Herobrine Awakening   Days pass. Steve visits ancient ruins. He decides to face Null without powers.   He finds Null again — and gets hit violently, almost dying.   This triggers a transformation:   > “Awaken... Herobrine.”       Cinematic animation: glowing eyes, thunderstorm, ancient symbols appear. Steve transforms into Herobrine Ascendant.   Emotional soundtrack + glowing UI changes.       ---   ⚔️ ACT 3: The Rift of Eternity – The Legendary Path   The world is glitching. Shadow minions appear.   Herobrine travels through corrupted biomes: 🔹 Glitch Wastes 🔹 Soul Caverns 🔹 Void Forest 🔹 Darkstorm Mountains   Defeats powerful bosses:   🩸 Glitch Revenant   🔥 Flamebound Brute   ⚡ Stormcaller   🧊 Entity 303 (secret optional boss!)   🗡️ Shadowbound Warrior         ---   ⚔️ FINAL ACT: Rise of Prime – The Final War Begins   Arrives at The Rift of Eternity (final battle map): ⛰️ Floating mountains 🔥 Lava eruptions ⛓️ Chains from sky 🌩️ Storm and glitch FX everywhere   Final Cutscene Begins:   > "So… Herobrine finally wakes." – Prime Null         👑 FINAL BATTLE:   Boss Fight: Prime Null vs Herobrine Ascendant   3 Phases: Teleportation, Blade of the Void, Summon Minions   Environment collapses: blocks fly, camera shakes   Epic soundtrack plays with subtitles (EN + Sinhala)   Cutscene finishes with Null screaming:   > “I… will come back… from the Dark Prison!”       Black screen: “Season 2 Coming Soon”         ---   💥 WHAT’S INCLUDED IN THE MOD:   🎮 GAMEPLAY   4–6 hours of playtime   Hard mode with permadeath   Questline system with cutscene triggers   Save/load checkpoints       ---   🦸 CHARACTERS (Fully Animated)   Steve / Herobrine Ascendant   Alex (dies early)   Null (base + Prime Null final form)   Optional Bosses:   Entity 303   Flamebound Brute   Soul Warden   Shadowbound Warrior   Stormcaller   Glitch Revenant         ---   🧩 QUESTS   12+ main quests   6+ side quests (some unlock alternate endings)   Ritual quests to summon Herobrine powers       ---   🔫 WEAPONS / ITEMS   ⚡ Lightning Staff   🗡️ Void Piercer Blade   🔥 Flame Reaper   🧊 Frozen Thunder Shuriken   💎 Alex’s Amulet (used in story)       ---   💥 PARTICLE EFFECTS & CINEMATICS   Crying, rain, lightning, fire   Custom shaders (optional but NOT required)   Camera shake, blur, glow   Flying blocks during battles   Realistic terrain destruction       ---   🎬 TRAILER   Cinematic shots   Text overlays   Background score   Your name and mine: Developed by: Navindu Heshan & The Golden Friend   Ends with🌍 TITLE:   Herobrine vs Null – Rise of Prime   > “Rewrite Minecraft history. Witness the rise… and the fall.”         ---   🧩 MOD VERSION:   Minecraft Forge 1.20.1   Built with MCreator   Ultra-cinematic style, custom mobs, weapons, quests, effects, emotional cutscenes       ---   📖 FULL STORY (Final Draft):   ⚔️ ACT 1: Alex’s Death – The Beginning of Darkness   Peaceful world. Alex and Steve explore a new cave.   Suddenly, Null appears from the shadows, corrupts the land, and strikes Alex with a void blade.   A powerful cinematic cutscene plays. Alex dies in Steve’s arms.   Steve collapses crying, lightning and rain begin, music swells.       ---   ⚔️ ACT 2: Broken and Angry – The Herobrine Awakening   Days pass. Steve visits ancient ruins. He decides to face Null without powers.   He finds Null again — and gets hit violently, almost dying.   This triggers a transformation:   > “Awaken... Herobrine.”       Cinematic animation: glowing eyes, thunderstorm, ancient symbols appear. Steve transforms into Herobrine Ascendant.   Emotional soundtrack + glowing UI changes.       ---   ⚔️ ACT 3: The Rift of Eternity – The Legendary Path   The world is glitching. Shadow minions appear.   Herobrine travels through corrupted biomes: 🔹 Glitch Wastes 🔹 Soul Caverns 🔹 Void Forest 🔹 Darkstorm Mountains   Defeats powerful bosses:   🩸 Glitch Revenant   🔥 Flamebound Brute   ⚡ Stormcaller   🧊 Entity 303 (secret optional boss!)   🗡️ Shadowbound Warrior         ---   ⚔️ FINAL ACT: Rise of Prime – The Final War Begins   Arrives at The Rift of Eternity (final battle map): ⛰️ Floating mountains 🔥 Lava eruptions ⛓️ Chains from sky 🌩️ Storm and glitch FX everywhere   Final Cutscene Begins:   > "So… Herobrine finally wakes." – Prime Null         👑 FINAL BATTLE:   Boss Fight: Prime Null vs Herobrine Ascendant   3 Phases: Teleportation, Blade of the Void, Summon Minions   Environment collapses: blocks fly, camera shakes   Epic soundtrack plays with subtitles (EN + Sinhala)   Cutscene finishes with Null screaming:   > “I… will come back… from the Dark Prison!”       Black screen: “Season 2 Coming Soon”         ---   💥 WHAT’S INCLUDED IN THE MOD:   🎮 GAMEPLAY   4–6 hours of playtime   Hard mode with permadeath   Questline system with cutscene triggers   Save/load checkpoints       ---   🦸 CHARACTERS (Fully Animated)   Steve / Herobrine Ascendant   Alex (dies early)   Null (base + Prime Null final form)   Optional Bosses:   Entity 303   Flamebound Brute   Soul Warden   Shadowbound Warrior   Stormcaller   Glitch Revenant         ---   🧩 QUESTS   12+ main quests   6+ side quests (some unlock alternate endings)   Ritual quests to summon Herobrine powers       ---   🔫 WEAPONS / ITEMS   ⚡ Lightning Staff   🗡️ Void Piercer Blade   🔥 Flame Reaper   🧊 Frozen Thunder Shuriken   💎 Alex’s Amulet (used in story)       ---   💥 PARTICLE EFFECTS & CINEMATICS   Crying, rain, lightning, fire   Custom shaders (optional but NOT required)   Camera shake, blur, glow   Flying blocks during battles   Realistic terrain destruction       ---   🎬 TRAILER   Cinematic shots   Text overlays   Background score   Your name and mine: Developed by: Navindu Heshan & The Golden Friend   Ends with release date: JULY 16       ---   🧠 SPECIAL FEATURES:   Secret ending (if you don’t kill Null)   Killcam-style boss finishers   Hidden rooms + “Void Realm” area   Hard mode unlocks Glitched Steve as final secret .can you make it real.       ---   🧠 SPECIAL FEATURES:   Secret ending (if you don’t kill Null)   Killcam-style boss finishers   Hidden rooms + “Void Realm” area   Hard mode unlocks Glitched Steve as final secret .can you make it
    • Make a test with another Launcher like the Curseforge Launcher, MultiMC or AT Launcher
    • can anyone help me i am opening forge and add modpacks and then it says unable to update native luancher and i redownlaod java and the luancher it self?
    • The problem occurs also in 1.20.1 Forge, but with an "Error executing task on client" instead. I have "Sinytra Connector" installed. On 1.21.5 Fabric, there is no problem. When this happens, the chat message before the death screen appears gets sent, with an extra dash added.
    • Well, as usual, it was user error. Naming mismatch in sounds.json.  Please delete this post if you find it necessary. 
  • Topics

×
×
  • Create New...

Important Information

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