Help with Dragon model

Started by Ikermp10 on

Topic category: Help with modding (Java Edition)

Last seen on 15:27, 25. Aug 2022
Joined Apr 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Help with Dragon model
Sun, 04/05/2020 - 13:53 (edited)

Every time I fix an error, the model is invisible in clinet world. And it always gives me two erros.

Here is the code part that speaks about the model (that is the Ender Dragon model): 

@ElementsSuperArmasMod.ModElement.Tag public class EntityDragondelCielo extends ElementsSuperArmasMod.ModElement{
    public static final int ENTITYID = 5;
    public static final int ENTITYID_RANGED = 6;
    public EntityDragondelCielo (ElementsSuperArmasMod instance) {
        super(instance, 17);
    }
    @Override public void initElements() {
        elements.entities.add(() -> EntityEntryBuilder.create().entity(EntityCustom.class)
                                .id(new ResourceLocation("super_armas_mod", "dragondelcielo"), ENTITYID).name("dragondelcielo").tracker(64, 3, true)
                                .egg(-16724788, -1)
                                .build());
    }
    @Override public void init(FMLInitializationEvent event) {
            Biome[] spawnBiomes = {
                    Biome.REGISTRY.getObject(new ResourceLocation("extreme_hills")),
            };
        EntityRegistry.addSpawn(EntityCustom.class, 8, 1, 3,
            EnumCreatureType.CREATURE, spawnBiomes);
    }
    @SideOnly(Side.CLIENT) @Override public void preInit(FMLPreInitializationEvent event) {
            RenderingRegistry.registerEntityRenderingHandler(EntityCustom.class, renderManager -> {
                return new RenderLiving(renderManager, new Modelskydragon_model(), 0.5f) {
                        protected ResourceLocation getEntityTexture(Entity entity) {
                            return new ResourceLocation("super_armas_mod:textures/ragon_del_ielo.png");
                        }
                    };
            });
    }
    public static class EntityCustom extends EntityAnimal {
        public EntityCustom(World world) {
            super(world);
            setSize(0.6f, 1.8f);
            experienceValue = 100;
            this.isImmuneToFire = false;
            setNoAI(!true);
                enablePersistence();
            this.navigator = new PathNavigateFlying(this, this.world);
            this.moveHelper = new EntityFlyHelper(this);
        }
        @Override protected void initEntityAI() {
            super.initEntityAI();
                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 EntityAIWander(this, 0.8, 20) {
    @Override protected Vec3d getPosition() {
        Random random = EntityCustom.this.getRNG();
        double dir_x = EntityCustom.this.posX + ((random.nextFloat() * 2 - 1) * 16);
        double dir_y = EntityCustom.this.posY + ((random.nextFloat() * 2 - 1) * 16);
        double dir_z = EntityCustom.this.posZ + ((random.nextFloat() * 2 - 1) * 16);
        return new Vec3d(dir_x, dir_y, dir_z);
    }
});
this.tasks.addTask(6,new EntityAIPanic(this,1.2));this.targetTasks.addTask(7,new EntityAIHurtByTarget(this, false));
                this.tasks.addTask(3, new EntityAIMate(this, 1.0D));
        }
        @Override public EnumCreatureAttribute getCreatureAttribute() {
            return EnumCreatureAttribute.UNDEFINED;
        }
        @Override protected boolean canDespawn() {
            return false;
        }
        @Override protected Item getDropItem() {
                return null;
        }
        @Override public net.minecraft.util.SoundEvent getAmbientSound() {
            return (net.minecraft.util.SoundEvent) net.minecraft.util.SoundEvent.REGISTRY
                    .getObject(new ResourceLocation("entity.enderdragon.ambient"));
        }
        @Override public net.minecraft.util.SoundEvent getHurtSound(DamageSource ds) {
            return (net.minecraft.util.SoundEvent) net.minecraft.util.SoundEvent.REGISTRY
                    .getObject(new ResourceLocation("entity.enderdragon.hurt"));
        }
        @Override public net.minecraft.util.SoundEvent getDeathSound() {
            return (net.minecraft.util.SoundEvent) net.minecraft.util.SoundEvent.REGISTRY
                    .getObject(new ResourceLocation("entity.enderdragon.death"));
        }
        @Override protected float getSoundVolume() {
            return 1.0F;
        }
        @Override public void fall(float l, float d) {
        }
        @Override public boolean attackEntityFrom(DamageSource source, float amount) {
                if (source.getImmediateSource() instanceof EntityPotion)
                    return false;
                if (source == DamageSource.FALL)
                    return false;
                if (source == DamageSource.LIGHTNING_BOLT)
                    return false;
            return super.attackEntityFrom(source, amount);
        }
        @Override public boolean processInteract(EntityPlayer entity, EnumHand hand) {
            super.processInteract(entity, hand);
            entity.startRiding(this);
            int x = (int) this.posX;
            int y = (int) this.posY;
            int z = (int) this.posZ;
            ItemStack itemstack = entity.getHeldItem(hand);
            return true;
        }
        @Override protected void applyEntityAttributes() {
            super.applyEntityAttributes();
            if (this.getEntityAttribute(SharedMonsterAttributes.ARMOR) != null)
                this.getEntityAttribute(SharedMonsterAttributes.ARMOR).setBaseValue(0D);
            if (this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED) != null)
                this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.3D);
            if (this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH) != null)
                this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(500D);
            if (this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE) != null)
                this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(50D);
            this.getAttributeMap().registerAttribute(SharedMonsterAttributes.FLYING_SPEED);
            this.getEntityAttribute(SharedMonsterAttributes.FLYING_SPEED).setBaseValue(0.3);
        }
            @Override public EntityCustom createChild(EntityAgeable ageable) {
                return new EntityCustom(world);
            }
            @Override public float getEyeHeight() {
                return this.isChild() ? this.height : 1.3F;
            }
            @Override public boolean isBreedingItem(ItemStack stack) {
                if (stack == null)
                    return false;
                    if (new ItemStack(Items.CAKE, (int)(1)).getItem() == stack.getItem())
                        return true;
                    if (new ItemStack(Items.PUMPKIN_PIE, (int)(1)).getItem() == stack.getItem())
                        return true;
                    if (new ItemStack(Blocks.AIR, (int)(1)).getItem() == stack.getItem())
                        return true;
                return false;
            }
        @Override public void onUpdate() {
            super.onUpdate();
            this.setNoGravity(true);
        }
            @Override public void travel(float ti, float tj, float tk) {
                Entity entity = this.getPassengers().isEmpty() ? null : (Entity) this.getPassengers().get(0);
                if (this.isBeingRidden()) {
                    this.rotationYaw = entity.rotationYaw;
                    this.prevRotationYaw = this.rotationYaw;
                    this.rotationPitch = entity.rotationPitch * 0.5F;
                    this.setRotation(this.rotationYaw, this.rotationPitch);
                    this.jumpMovementFactor = this.getAIMoveSpeed() * 0.15F;
                    this.renderYawOffset = entity.rotationYaw;
                    this.rotationYawHead = entity.rotationYaw;
                    this.stepHeight = 1.0F;
                    if (entity instanceof EntityLivingBase) {
                        this.setAIMoveSpeed((float) this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).getAttributeValue());
                            float forward = ((EntityLivingBase) entity).moveForward;
                            float strafe = 0;
                        super.travel(strafe, 0, forward);
                    }
                    this.prevLimbSwingAmount = this.limbSwingAmount;
                    double d1 = this.posX - this.prevPosX;
                    double d0 = this.posZ - this.prevPosZ;
                    float f1 = MathHelper.sqrt(d1 * d1 + d0 * d0) * 4.0F;
                    if (f1 > 1.0F) f1 = 1.0F;
                    this.limbSwingAmount += (f1 - this.limbSwingAmount) * 0.4F;
                    this.limbSwing += this.limbSwingAmount;
                    return;
                }
                this.stepHeight = 0.5F;
                this.jumpMovementFactor = 0.02F;
                super.travel(ti, tj, tk);
            }
        @Override protected void updateFallState(double y, boolean onGroundIn, IBlockState state, BlockPos pos) {
           }
           @Override public void setNoGravity(boolean ignored) {
            super.setNoGravity(true);
        }
    }
        ï»¿public static class Modelskydragon_model extends ModelBase {
 Techne TechneObject;
 // Getter Methods 
 public Techne getTechne() {
  return TechneObject;
 }
 // Setter Methods 
 public void setTechne(Techne TechneObject) {
  this.TechneObject = TechneObject;
 }
}
public static class Techne {
 public String Author;
 public String DateCreated;
 public String Description;
 Models ModelsObject;
 public String Name;
 public String _Version;
 // Getter Methods 
 public String getAuthor() {
  return Author;
 }
 public String getDateCreated() {
  return DateCreated;
 }
 public String getDescription() {
  return Description;
 }
 public Models getModels() {
  return ModelsObject;
 }
 public String getName() {
  return Name;
 }
 public String get_Version() {
  return _Version;
 }
 // Setter Methods 
 public void setAuthor(String Author) {
  this.Author = Author;
 }
 public void setDateCreated(String DateCreated) {
  this.DateCreated = DateCreated;
 }
 public void setDescription(String Description) {
  this.Description = Description;
 }
 public void setModels(Models ModelsObject) {
  this.ModelsObject = ModelsObject;
 }
 public void setName(String Name) {
  this.Name = Name;
 }
 public void set_Version(String _Version) {
  this._Version = _Version;
 }
}
public static class Models {
 Model ModelObject;
 // Getter Methods 
 public Model getModel() {
  return ModelObject;
 }
 // Setter Methods 
 public void setModel(Model ModelObject) {
  this.ModelObject = ModelObject;
 }
}
public static class Model {
 public String BaseClass;
 public String Name;
 public String DefaultTexture;
 Geometry GeometryObject;
 public String TextureSize;
 public String _Texture;
 // Getter Methods 
 public String getBaseClass() {
  return BaseClass;
 }
 public String getName() {
  return Name;
 }
 public String getDefaultTexture() {
  return DefaultTexture;
 }
 public Geometry getGeometry() {
  return GeometryObject;
 }
 public String getTextureSize() {
  return TextureSize;
 }
 public String get_Texture() {
  return _Texture;
 }
 // Setter Methods 
 public void setBaseClass(String BaseClass) {
  this.BaseClass = BaseClass;
 }
 public void setName(String Name) {
  this.Name = Name;
 }
 public void setDefaultTexture(String DefaultTexture) {
  this.DefaultTexture = DefaultTexture;
 }
 public void setGeometry(Geometry GeometryObject) {
  this.GeometryObject = GeometryObject;
 }
 public void setTextureSize(String TextureSize) {
  this.TextureSize = TextureSize;
 }
 public void set_Texture(String _Texture) {
  this._Texture = _Texture;
 }
}
public static class Geometry {
 Folder FolderObject;
 // Getter Methods 
 public Folder getFolder() {
  return FolderObject;
 }
 // Setter Methods 
 public void setFolder(Folder FolderObject) {
  this.FolderObject = FolderObject;
 }
}
public static class Folder {
 ArrayList < Object > Shape = new ArrayList < Object > ();
 public String _Type;
 public String _Name;
 // Getter Methods 
 public String get_Type() {
  return _Type;
 }
 public String get_Name() {
  return _Name;
 }
 // Setter Methods 
 public void set_Type(String _Type) {
  this._Type = _Type;
 }
 public void set_Name(String _Name) {
  this._Name = _Name;
 }
}
}

Thanks for the help!

Edited by Ikermp10 on Sun, 04/05/2020 - 13:53
Last seen on 15:52, 24. Feb 2024
Joined Jan 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
even through i don't know…
Sun, 04/05/2020 - 13:07

even through i don't know about the error i do know that if you use outdated block bench the error will occur try use different modeler and the latest one

Last seen on 15:27, 25. Aug 2022
Joined Apr 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I use the lastest of techne…
Mon, 04/06/2020 - 09:29

I use the lastest of techne and blockbench, the model is the enderdragon model from MC3DSkin, I converted it into a java file so I can use it but it always gives me this error.

Last seen on 15:52, 24. Feb 2024
Joined Jan 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
well you should create you…
Mon, 04/06/2020 - 10:41

well you should create you model youself because if you download model it can cause error 

Last seen on 15:52, 24. Feb 2024
Joined Jan 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
also dont use web/com…
Mon, 04/06/2020 - 11:11

also dont use web/com converter they gave error