Started by
minsin56
on
Topic category: Troubleshooting, bugs, and solutions
i am using mcreator 1.7.9 an i am trying to make a mob but animations don't work i selected the correct parts in the animation wizzard but the animations don't work no matter what i do
Give more information such as the code for the mob so that others can be able to figure it out. Also put it in the help section of the forums.
Hope this helps.
i got the same problem
and i got the code
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.world.BossInfoServer;
import net.minecraft.world.BossInfo;
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.EntityPlayerMP;
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.EntityLivingBase;
import net.minecraft.entity.Entity;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.Minecraft;
import java.util.Random;
import java.util.Iterator;
import java.util.ArrayList;
@SuppressWarnings("unchecked")
public class mcreator_thefinalendboss {
public int mobid = 75;
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() {
RenderLiving customRender = new RenderLiving(Minecraft.getMinecraft().getRenderManager(), new mcreator_thefinalendboss.ModelNew(), 0) {
protected ResourceLocation getEntityTexture(Entity par1Entity) {
return new ResourceLocation("new2 textured.png");
}
};
RenderingRegistry.registerEntityRenderingHandler(mcreator_thefinalendboss.Entitythefinalendboss.class, customRender);
}
public void serverLoad(FMLServerStartingEvent event) {
}
public void preInit(FMLPreInitializationEvent event) {
EntityRegistry.registerModEntity(new ResourceLocation("testenvironmentmod:thefinalendboss"),
mcreator_thefinalendboss.Entitythefinalendboss.class, "thefinalendboss", mobid, instance, 64, 1, true, (0 << 16) + (204 << 8) + 255,
(102 << 16) + (0 << 8) + 102);
}
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 Entitythefinalendboss extends EntityMob {
World world = null;
public Entitythefinalendboss(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
public boolean isNonBoss() {
return false;
}
private final BossInfoServer bossInfo = (BossInfoServer) (new BossInfoServer(this.getDisplayName(), BossInfo.Color.BLUE,
BossInfo.Overlay.PROGRESS));
@Override
public void addTrackingPlayer(EntityPlayerMP player) {
super.addTrackingPlayer(player);
this.bossInfo.addPlayer(player);
}
@Override
public void removeTrackingPlayer(EntityPlayerMP player) {
super.removeTrackingPlayer(player);
this.bossInfo.removePlayer(player);
}
@Override
public void onUpdate() {
super.onUpdate();
this.bossInfo.setPercent(this.getHealth() / this.getMaxHealth());
}
@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;
}
}
// Date: 24-7-2018 08:45:06
// Template version 1.1
// Java generated by Techne
// Keep in mind that you still need to fill in some blanks
// - ZeuX
public static class ModelNew extends ModelBase {
// fields
ModelRenderer head;
ModelRenderer body;
ModelRenderer rightarm;
ModelRenderer leftarm;
ModelRenderer rightleg;
ModelRenderer leftleg;
public ModelNew() {
textureWidth = 256;
textureHeight = 128;
head = new ModelRenderer(this, 71, 0);
head.addBox(-8F, -16F, -8F, 16, 16, 16);
head.setRotationPoint(0F, -24F, 0F);
head.setTextureSize(256, 128);
head.mirror = true;
setRotation(head, 0F, 0F, 0F);
body = new ModelRenderer(this, 73, 37);
body.addBox(-8F, 0F, -4F, 16, 24, 8);
body.setRotationPoint(0F, -24F, 0F);
body.setTextureSize(256, 128);
body.mirror = true;
setRotation(body, 0F, 0F, 0F);
rightarm = new ModelRenderer(this, 35, 56);
rightarm.addBox(-8F, -2F, -4F, 8, 24, 8);
rightarm.setRotationPoint(-8F, -22F, 0F);
rightarm.setTextureSize(256, 128);
rightarm.mirror = true;
setRotation(rightarm, 0F, 0F, 0F);
leftarm = new ModelRenderer(this, 36, 16);
leftarm.addBox(0F, -2F, -4F, 8, 24, 8);
leftarm.setRotationPoint(8F, -22F, 0F);
leftarm.setTextureSize(256, 128);
leftarm.mirror = true;
setRotation(leftarm, 0F, 0F, 0F);
rightleg = new ModelRenderer(this, 0, 56);
rightleg.addBox(-4F, 0F, -4F, 8, 24, 8);
rightleg.setRotationPoint(-4F, 0F, 0F);
rightleg.setTextureSize(256, 128);
rightleg.mirror = true;
setRotation(rightleg, 0F, 0F, 0F);
leftleg = new ModelRenderer(this, 0, 16);
leftleg.addBox(-4F, 0F, -4F, 8, 24, 8);
leftleg.setRotationPoint(4F, 0F, 0F);
leftleg.setTextureSize(256, 128);
leftleg.mirror = true;
setRotation(leftleg, 0F, 0F, 0F);
}
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
super.render(entity, f, f1, f2, f3, f4, f5);
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
head.render(f5);
body.render(f5);
rightarm.render(f5);
leftarm.render(f5);
rightleg.render(f5);
leftleg.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);
}
}
}
i also have this problem
You're missing the last bits with the rotation points and floats... Basically it means your animation wizard didn't generate the code for the animation...
I used to have the same problem, check it out, at the end we find a solution...
https://mcreator.net/comment/49186