Моб странно ведёт при создании через world.spawnEntityInWorld

Версия Minecraft
1.7.10
Вот так выглядит создание:

Java:
 public boolean onBlockActivated(World world, int p2,int p3,int p4,EntityPlayer player,int p6,float p7,float p8,float p9)
   { 
       double x = p2;
       double y = p3;
       double z = p4;
       if (!world.isRemote) {
           MobSSL mobAHAX = new MobSSL(world);
           EntityMob ent = mobAHAX;
           ent.posY = y;
           ent.posX = x;
           ent.posZ = z;
           world.spawnEntityInWorld(ent);
           world.setBlockToAir(p2, p3, p4); 
       }
       return false;
   }

Однако,при выполнении данной функции(метода)(нажатие ПКМ),моб спавнится,но он:
  • не двигается
  • ему не наносится урон
  • он пропадает через секунд 4 - 120
 
А в нем ты что написал? Наверняка моб без ИИ и прочих параметров.
Java:
package ru.mixorio.fora;

import java.util.Arrays;

import cpw.mods.fml.common.registry.EntityRegistry;
import net.minecraft.block.Block;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIAttackOnCollide;
import net.minecraft.entity.ai.EntityAIHurtByTarget;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.passive.EntityChicken;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;

public class MobSSL extends EntityMob
{
public MobSSL(World par1World)
  {
  super(par1World);
  this.tasks.addTask(1, new  EntityAISwimming(this));
  this.tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, false));
  this.tasks.addTask(3, new EntityAIWander(this, 1.0D));
  this.tasks.addTask(4, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
  this.tasks.addTask(5, new EntityAILookIdle(this));

  this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
  this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true));
 
  }
@Override
protected void applyEntityAttributes()
{
  super.applyEntityAttributes();
  this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(40.0D);
  this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(120.0D);
  this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setBaseValue(0.2D);
  this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30D);
  this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(4.0D);
}
public boolean isAIEnabled()
{
   return true;
}
protected int getExperiencePoints(EntityPlayer p_70693_1_)
{
    if (this.isChild())
    {
        this.experienceValue = (int)((float)this.experienceValue * 4.5F);
    }

    return super.getExperiencePoints(p_70693_1_);
}

protected Item getDropItem()
{
    return Item.getItemFromBlock(Main.blockGDCS);//Main.blockGDCS;
}
}
Вся проблема в том,если спавнить через яйцо - всё ок.
 
167
10
69
MobSSL mobAHAX = new MobSSL(world); EntityMob ent = mobAHAX; ent.posY = y; ent.posX = x; ent.posZ = z; world.spawnEntityInWorld(ent);
Попробуй для начала спаунить так
Java:
MobSSL mobAHAX = new MobSSL(world);
ent.posY = y;
ent.posX = x;
ent.posZ = z;
world.spawnEntityInWorld(mobAHAX);
world.setBlockToAir(p2, p3, p4);
 
3,005
192
592
От какого класса
Так, для инфы, твой моб наследуется от
Просто незнание явы не говорит, что ты должен сначала познавать апи майна, а только потом явы.

Если погуглить больше 0 секунд, можно найти метод setLocationAndAngles / setPosition.
 
Сверху