Не появляется моб

Версия Minecraft
1.12.2
API
Forge
37
1
3
Делал по этому гайду: Создание своего моба
Единтственное, что поменял - попытался сделать летающего моба, используя EntityBlaze implements IRangedAttackMob и взял модель ифрита.
Не понимаю, в чём проблема. Игра не крашится, яйцо спавна есть, но при импользовании моб не появляется. Естетсвенно, сложность нормальная.

Класс моба:
package ua.andrey08xtomyoll.mineadditions.entity;

import net.minecraft.entity.*;
import net.minecraft.entity.ai.*;
import net.minecraft.entity.monster.EntityBlaze;
import net.minecraft.world.World;

public class EntityCustomBlaze extends EntityBlaze implements IRangedAttackMob {
    //Наш доп. урон(ниже о нём)
    public static int ADD_DAMAGE = 15;

    /[I]Конструктор[/I]/
    public EntityCustomBlaze(World world) {
        super(world);
        setSize(0.6F, 1.98F);//Размер моба
    }

    /[I]Конструктор с установкой позиции[/I]/
    public EntityCustomBlaze(World world, double x, double y, double z) {
        super(world);
        setSize(0.6F, 1.98F);//Размер моба
        setPositionAndUpdate(x, y, z);
    }

    @Override
    protected void applyEntityAttributes() {
        /[I]Строчка ниже нужна для регистрации атрибутов(Макс. ХП, скорость, сила атаки, броня, скорость полёта и тд.)[/I]/
        super.applyEntityAttributes();
        //Устанавливаем атрибуты
        this.getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(35.0D);
        this.getEntityAttribute(SharedMonsterAttributes.FLYING_SPEED).setBaseValue(0.5D);
        this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(3.0D);
        this.getEntityAttribute(SharedMonsterAttributes.ARMOR).setBaseValue(2.0D);
        this.getEntityAttribute(SharedMonsterAttributes.ARMOR_TOUGHNESS).setBaseValue(2.0D); отбрасование)
    }
    protected void initEntityAI() {
        super.initEntityAI();
        this.tasks.addTask(1, new EntityAIWander(this, 0.9));
        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));
        this.tasks.addTask(1, new EntityAIAttackRanged(this, 1.25D, 20, 10.0F));
    }

    @Override
    public boolean attackEntityAsMob(Entity entityIn) {
        /[I]Что происходит при атаке[/I]/
        if (super.attackEntityAsMob(entityIn)) {
            if (entityIn instanceof EntityLivingBase) {
                ((EntityLivingBase) entityIn).attackEntityAsMob(this);
                entityIn.attackEntityFrom(((EntityLivingBase) entityIn).getLastDamageSource(), rand.nextInt(ADD_DAMAGE));//Наносим доп. урон
            }
            return true;
        } else {
            return false;
        }
    }

    @Override
    public int getMaxSpawnedInChunk() {
        /[I]Сколько спавнится в чанке[/I]/
        return 25;
    }

    @Override
    public void attackEntityWithRangedAttack(EntityLivingBase entityLivingBase, float v) {

    }

    @Override
    public void setSwingingArms(boolean b) {

    }
}

Регистрация моба:
package ua.andrey08xtomyoll.mineadditions.entity;


import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.client.registry.RenderingRegistry;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.registry.EntityEntry;
import net.minecraftforge.fml.common.registry.EntityEntryBuilder;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import ua.andrey08xtomyoll.mineadditions.util.Reference;

@Mod.EventBusSubscriber(modid = Reference.MOD_ID)
public class EntityRegistry
{
    @SideOnly(Side.CLIENT)//Только клиент
    public static void initModels() {
        /*Регистрируем рендер, 1 параметр = класс моба, 2 параметр = НАШ РЕНДЕР ФЭКТОРИ */
        RenderingRegistry.registerEntityRenderingHandler(EntityCustomBlaze.class, RenderCustomBlaze.FACTORY);
    }

    private static int ID = 0;//Для айди
    public static EntityEntry CUSTOM_BLAZE = EntityEntryBuilder
            .create()//Создаём новый EntityEntry
            .entity(EntityCustomBlaze.class)//Какой моб в EntityEntry
            .name("Custom Blaze")//мя
            .id("custom_blaze", ID++)//Айди и имя регистрации
            .egg(0xff4040, 0xd891ef)//Цвет яйца, первое значение - фона, второе - "точек"(можно не добавлять)
            .tracker(160, 2, false)//Трекер моба(Первое значение - радиус для которого моб будет обновлятся, второе - частота обновлений за секунду, третье - будет ли отправляться пакет с обновление позиции игрокам)
            .build();//Устанавливаем параметры

    @SubscribeEvent
    public static void registryEntity(RegistryEvent.Register<EntityEntry> event) {
        /[I]Новая регистрация от форджа[/I]/
        event.getRegistry().registerAll(
                CUSTOM_BLAZE
        );
    }
}

Рендер модели:
package ua.andrey08xtomyoll.mineadditions.entity;

import net.minecraft.client.model.ModelBlaze;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.util.ResourceLocation;
import ua.andrey08xtomyoll.mineadditions.util.Reference;
import net.minecraftforge.fml.client.registry.IRenderFactory;

import javax.annotation.Nonnull;

public class RenderCustomBlaze extends RenderLiving<EntityCustomBlaze>
{
    private ResourceLocation mobTexture = new ResourceLocation(Reference.MOD_ID + ":textures/entity/skin_custom_blaze.png");

    public RenderCustomBlaze(RenderManager manager) {
        super(manager, new ModelBlaze(), 0.5F);
    }

    public static Factory FACTORY = new Factory();
    @Override
    @Nonnull
    protected ResourceLocation getEntityTexture(@Nonnull EntityCustomBlaze entity)
    {
        return  mobTexture;
    }

    public static class Factory implements IRenderFactory<EntityCustomBlaze>
    {
        @Override
        public Render<? super EntityCustomBlaze> createRenderFor(RenderManager manager)
        {
            return new RenderCustomBlaze(manager);
        }
    }
}

ClientProxy:
package ua.andrey08xtomyoll.mineadditions.proxy;

import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import ua.andrey08xtomyoll.mineadditions.entity.EntityRegistry;

public class ClientProxy extends CommonProxy
{
    @Override
    public void preInit(FMLPreInitializationEvent event)
    {
        super.preInit(event);
        EntityRegistry.initModels();
        System.out.println("Lds");
    }

    @Override
    public void init(FMLInitializationEvent event)
    {
        super.init(event);
    }

    @Override
    public void postInit(FMLPostInitializationEvent event) {
        super.postInit(event);
    }
   
    public void registerItemRenderer(Item item, int meta, String id)
    {
        ModelLoader.setCustomModelResourceLocation(item,meta,new ModelResourceLocation(item.getRegistryName(),id));
    }
}

CommonProxy:
package ua.andrey08xtomyoll.mineadditions.proxy;

import net.minecraft.item.Item;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import ua.andrey08xtomyoll.mineadditions.ModMain;
import ua.andrey08xtomyoll.mineadditions.handlers.GuiHandler;
import ua.andrey08xtomyoll.mineadditions.init.ModBlocks;

public class CommonProxy
{
    public void preInit(FMLPreInitializationEvent event)

    {
        ModBlocks.register();
    }

    public void init(FMLInitializationEvent event)
    {
        NetworkRegistry.INSTANCE.registerGuiHandler(ModMain.instance, new GuiHandler());
    }
   
    public void postInit(FMLPostInitializationEvent event) {
       
    }
   
    public void registerItemRenderer(Item item, int meta, String id)
    {

    }
}

Reference:
package ua.andrey08xtomyoll.mineadditions.util;

public class Reference
{
    public static final String MOD_ID = "mineadditions";
    public static final String NAME = "MineAdditions";
    public static final String VERSION = "1.0";
    public static final String ACCEPTED_VERSIONS = "[1.12.2]";
    public static final String CLIENT_PROXY_CLASS = "ua.andrey08xtomyoll.mineadditions.proxy.ClientProxy";
    public static final String COMMON_PROXY_CLASS = "ua.andrey08xtomyoll.mineadditions.proxy.CommonProxy";
   
    public static final boolean DEBUG = true;

}
 
Последнее редактирование:
Сверху