Как сделать чтобы моб спавнился в пещерах?

http://www.minecraftforge.net/forum/index.php?topic=16088.0
В классе моба переопредели метод:
Код:
@Override
    public boolean getCanSpawnHere() {
    return super.getCanSpawnHere() && yourMethodForIsEntityUnderground();
}
Можешь написать свой метод для проверки, находится ли блок под землей, либо используй ванильный canBlockSeeTheSky()
 
Мне кажется что я что-то не правильно делал:
Код:
package com.worldisdoomed.www.mob;

import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.world.World;

public class EntitySGolem extends EntityMob {

    public EntitySGolem(World par1World) {
        super(par1World);
        this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(50.0D);
        this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.699D);
        this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(6.0D);
        this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(7.0D);
        this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(8.0D);
    }
    
    @Override
    public boolean getCanSpawnHere() {
    return super.getCanSpawnHere() && canBlockSeeTheSky();
}

    private boolean canBlockSeeTheSky() {
        return false;
    }

}
 
Назад
Сверху