Topic category: User side tutorials
Mcreator doesn't give you the opportunity to choose from all different Models from vanilla Minecraft for your Mob (idk why), but you can still get all models of course and the coding is not that complicated.
BEFORE FOLLOWING THE STEPS:
Make sure you have everything else ready for your mob ready like A.I. or procedures. You probably
don't want to code it in.
THE TUTORIAL:
Very short tutorial actually. Nothing complicated really you just have to memorize the "Model Key Words".
Anyway let's start!
STEP 1:
Let's say you want a Golem. You put in the texture for the mob which is compatible with the Golem Model. You should ignore
what the entity will be rendered as. Save the mob.
STEP 2:
Go to the Code Tab and select your entity. Lock the code and put this line where the other imports are
import net.minecraft.client.model.<Entity's Model>;
in this case:
import net.minecraft.client.model.ModelIronGolem;
And then you search this. This is also somewhere at the beginning of the code:
public void registerRenderers() {
RenderLiving customRender = new RenderLiving(Minecraft.getMinecraft().getRenderManager(), new ModelBiped(), 0) {
You replace ModelBiped with the new Model (In this case ModelIronGolem) and then you click on "Save and build".
I have a list of "Model key words" you'll most likely use for your mob:
-ModelIronGolem
-ModelWitch
-ModelBlaze
-ModelRabbit
-ModelDragon (It's flatting its wings fast)
-ModelHorse
-ModelBat
-ModelSkeleton
-ModelWither
-ModelMagmaCube
-ModelOcelot
-ModelSheep1 (Sheep)
-ModelSheep2 (Wool of the Sheep)
-ModelEnderman
-ModelWolf
STEP 3:
Test your new mob!
THAT'S ALL, FOLKS!!
I have a question...
If i need, for example, a block model to my mob, and i dont know to use techne, i can put there "ModelFallingBlock" or something like that?
Hi. I guess that's not possible?
You must use Teche or Tabula to create java model (Tabula tutorial: create 16x16 shape and set offset to 8, 8, 8. Then, export project as texture map and java class. In java class export menu, first field must be net.minecraft.src)
Try this
In 1.7.9 it is now "Render" instead of "Model"
HELP!
C:\Pylo\MCreator179\forge\build\sources\main\java\mod\mcreator\mcreator_kosmosLordOfEntropy.java:60: error: cannot find symbol
RenderBiped customRender = new RenderBlaze(Minecraft.getMinecraft().getRenderManager(), new ModelBlaze(), 0) {
^
symbol: class RenderBlaze
location: class mcreator_kosmosLordOfEntropy
C:\Pylo\MCreator179\forge\build\sources\main\java\mod\mcreator\mcreator_kosmosLordOfEntropy.java:70: error: cannot find symbol
this.modelLeggings = new ModelBiped();
^
symbol: class ModelBiped
C:\Pylo\MCreator179\forge\build\sources\main\java\mod\mcreator\mcreator_kosmosLordOfEntropy.java:71: error: cannot find symbol
this.modelArmor = new ModelBiped();
^
symbol: class ModelBiped
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
3 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
You must replace ModelBiped with ModelBlaze!
Sith Sabers: Update to 1.8.2
This is what happened when i replaced ModelBiped with ModelBlaze:
C:\Pylo\MCreator179\forge\build\sources\main\java\mod\mcreator\mcreator_kosmosLordOfEntropy.java:60: error: incompatible types: ModelBlaze cannot be converted to ModelBiped
RenderBiped customRender = new RenderBiped(Minecraft.getMinecraft().getRenderManager(), new ModelBlaze(), 0) {
^
C:\Pylo\MCreator179\forge\build\sources\main\java\mod\mcreator\mcreator_kosmosLordOfEntropy.java:60: error: cannot find symbol
RenderBiped customRender = new RenderBiped(Minecraft.getMinecraft().getRenderManager(), new ModelBlaze(), 0) {
^
symbol: constructor (RenderManager,ModelBlaze,int)
C:\Pylo\MCreator179\forge\build\sources\main\java\mod\mcreator\mcreator_kosmosLordOfEntropy.java:70: error: incompatible types: ModelBlaze cannot be converted to ModelBiped
this.modelLeggings = new ModelBlaze();
^
C:\Pylo\MCreator179\forge\build\sources\main\java\mod\mcreator\mcreator_kosmosLordOfEntropy.java:71: error: incompatible types: ModelBlaze cannot be converted to ModelBiped
this.modelArmor = new ModelBlaze();
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
4 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
here is my code: (UNCHANGED from the prev error)
package mod.mcreator;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.common.registry.EntityRegistry;
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.client.registry.RenderingRegistry;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.World;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.EnumHand;
import net.minecraft.util.DamageSource;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Item;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAIPanic;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAILeapAtTarget;
import net.minecraft.entity.ai.EntityAIHurtByTarget;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.Entity;
import net.minecraft.client.renderer.entity.RenderBiped;
import net.minecraft.client.model.ModelBlaze;
import net.minecraft.client.Minecraft;
import java.util.Random;
import java.util.Iterator;
import java.util.ArrayList;
@SuppressWarnings("unchecked")
public class mcreator_kosmosLordOfEntropy {
public int mobid = 11;
public static Object instance;
public void load(FMLInitializationEvent event) {
}
public void generateNether(World world, Random random, int chunkX, int chunkZ) {
}
public void generateSurface(World world, Random random, int chunkX, int chunkZ) {
}
public int addFuel(ItemStack fuel) {
return 0;
}
@SideOnly(Side.CLIENT)
public void registerRenderers() {
RenderBiped customRender = new RenderBiped(Minecraft.getMinecraft().getRenderManager(), new ModelBlaze(), 0) {
protected ResourceLocation getEntityTexture(Entity par1Entity) {
return new ResourceLocation("kosmos,thelordofentropy.png");
}
};
customRender.addLayer(new net.minecraft.client.renderer.entity.layers.LayerHeldItem(customRender));
customRender.addLayer(new net.minecraft.client.renderer.entity.layers.LayerBipedArmor(customRender) {
protected void initArmor() {
this.modelLeggings = new ModelBlaze();
this.modelArmor = new ModelBlaze();
}
});
RenderingRegistry.registerEntityRenderingHandler(mcreator_kosmosLordOfEntropy.EntitykosmosLordOfEntropy.class, customRender);
}
public void serverLoad(FMLServerStartingEvent event) {
}
public void preInit(FMLPreInitializationEvent event) {
EntityRegistry.registerModEntity(new ResourceLocation("testenvironmentmod:kosmoslordofentropy"),
mcreator_kosmosLordOfEntropy.EntitykosmosLordOfEntropy.class, "kosmoslordofentropy", mobid, instance, 64, 1, true, (255 << 16)
+ (255 << 8) + 255, (255 << 16) + (255 << 8) + 255);
EntityRegistry.addSpawn(mcreator_kosmosLordOfEntropy.EntitykosmosLordOfEntropy.class, 20, 3, 30, EnumCreatureType.MONSTER,
allbiomes(Biome.REGISTRY));
}
public static Biome[] allbiomes(net.minecraft.util.registry.RegistryNamespaced<ResourceLocation, Biome> in) {
Iterator<Biome> itr = in.iterator();
ArrayList<Biome> ls = new ArrayList<Biome>();
while (itr.hasNext()) {
ls.add(itr.next());
}
return ls.toArray(new Biome[ls.size()]);
}
public static class EntitykosmosLordOfEntropy extends EntityMob {
World world = null;
public EntitykosmosLordOfEntropy(World var1) {
super(var1);
world = var1;
experienceValue = 5;
this.isImmuneToFire = false;
addRandomArmor();
setNoAI(!true);
this.tasks.addTask(1, new EntityAIWander(this, 1));
this.tasks.addTask(2, new EntityAILookIdle(this));
this.tasks.addTask(3, new EntityAISwimming(this));
this.tasks.addTask(4, new EntityAILeapAtTarget(this, (float) 0.8));
this.tasks.addTask(5, new EntityAIPanic(this, 1.2));
this.targetTasks.addTask(6, new EntityAIHurtByTarget(this, false));
}
protected void applyEntityAttributes() {
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D);
this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(10D);
if (this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE) != null)
this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(3D);
}
protected void addRandomArmor() {
}
@Override
protected Item getDropItem() {
return null;
}
@Override
protected net.minecraft.util.SoundEvent getAmbientSound() {
return (net.minecraft.util.SoundEvent) net.minecraft.util.SoundEvent.REGISTRY.getObject(new ResourceLocation(""));
}
@Override
protected net.minecraft.util.SoundEvent getHurtSound(DamageSource ds) {
return (net.minecraft.util.SoundEvent) net.minecraft.util.SoundEvent.REGISTRY.getObject(new ResourceLocation("game.neutral.hurt"));
}
@Override
protected net.minecraft.util.SoundEvent getDeathSound() {
return (net.minecraft.util.SoundEvent) net.minecraft.util.SoundEvent.REGISTRY.getObject(new ResourceLocation("game.neutral.die"));
}
@Override
public void onStruckByLightning(EntityLightningBolt entityLightningBolt) {
super.onStruckByLightning(entityLightningBolt);
int i = (int) this.posX;
int j = (int) this.posY;
int k = (int) this.posZ;
Entity entity = this;
}
@Override
public void fall(float l, float d) {
super.fall(l, d);
int i = (int) this.posX;
int j = (int) this.posY;
int k = (int) this.posZ;
Entity entity = this;
}
/**
* Called when the entity is attacked.
*/
@Override
public boolean attackEntityFrom(DamageSource source, float amount) {
boolean retval = super.attackEntityFrom(source, amount);
int i = (int) this.posX;
int j = (int) this.posY;
int k = (int) this.posZ;
Entity entity = this;
return retval;
}
@Override
public void onDeath(DamageSource source) {
super.onDeath(source);
int i = (int) this.posX;
int j = (int) this.posY;
int k = (int) this.posZ;
Entity entity = this;
}
@Override
public boolean processInteract(EntityPlayer entity, EnumHand hand) {
boolean retval = super.processInteract(entity, hand);
int i = (int) this.posX;
int j = (int) this.posY;
int k = (int) this.posZ;
ItemStack itemstack = entity.getHeldItem(hand);
return retval;
}
@Override
public void onKillEntity(EntityLivingBase entity) {
super.onKillEntity(entity);
int i = (int) this.posX;
int j = (int) this.posY;
int k = (int) this.posZ;
}
@Override
public void onEntityUpdate() {
super.onEntityUpdate();
int i = (int) this.posX;
int j = (int) this.posY;
int k = (int) this.posZ;
Entity entity = this;
}
@Override
public void onCollideWithPlayer(EntityPlayer entity) {
super.onCollideWithPlayer(entity);
int i = (int) this.posX;
int j = (int) this.posY;
int k = (int) this.posZ;
}
@Override
protected float getSoundVolume() {
return 1.0F;
}
}
}
You can not pass an instance of ModelBlaze to RenderBiped, and no, RenderSomething is not equal to ModelSomething.
Those classes starting with "Model" stores the shape of the model, textures, and animations. The RenderSomething classes actually render those models, shadows and do various GL11 operations (+ they can have some more functionality depending on the exact type). Now the important thing. Every new instance of RenderSomething takes multiple arguments - the most important of them are RenderManager and some instance of ModelBase. The thing is, that some of those classes are abstract and can take a larger scope of models (for example RenderLiving takes all instances of ModelBase - basically any model, on the other hand, RenderBiped takes just instances of ModelBiped and RenderBlaze just instances of ModelBlaze). So to fix your issue you have to either:
How do you lock the code in step 3 and how do you find
public void registerRenderers() {
RenderLiving customRender = new RenderLiving(Minecraft.getMinecraft().getRenderManager(), new ModelBiped(), 0) {
You replace ModelBiped with the new Model (In this case ModelIronGolem) and then you click on "Save and build". ?
I cannot find this :
public void registerRenderers() {
RenderLiving customRender = new RenderLiving(Minecraft.getMinecraft().getRenderManager(), new ModelBiped(), 0) {
Im using MCreator version 2020.5 and it doesnt seem to be in the code anymore
edit the renderer not the entity if doing this is 2020.5
or you know not
This no longer works, as
public void registerRenderers() {
RenderLiving customRender = new RenderLiving(Minecraft.getMinecraft().getRenderManager(),
new ModelBiped(), 0) {
No longer exists for some reason