Um seine BÖSEN Mob zu ermöglichen das er jemanden folgt kommt folgendes rein
Code:
protected Entity findPlayerToAttack()
{
EntityPlayer entityplayer = worldObj.getClosestVulnerablePlayerToEntity(this, 64D);
if (entityplayer != null)
{
if (shouldAttackPlayer(entityplayer))
{
if (field_35185_e++ == 5)
{
field_35185_e = 0;
return entityplayer;
}
}
else
{
field_35185_e = 0;
}
}
return null;
}
Und dort wo du deine Textur für den mob definierst muss das rein
Dieser Script schnipsel müsste eigentlich die Aufnahmefunktion von Blöcken sein
Code:
public void setCarried(int i)
{
dataWatcher.updateObject(16, Byte.valueOf((byte)(i & 0xff)));
}
public int getCarried()
{
return dataWatcher.getWatchableObjectByte(16);
}
public void setCarryingData(int i)
{
dataWatcher.updateObject(17, Byte.valueOf((byte)(i & 0xff)));
}
public int getCarryingData()
{
return dataWatcher.getWatchableObjectByte(17);
}
static
{
canCarryBlocks = new boolean[256];
canCarryBlocks[Block.grass.blockID] = true;
canCarryBlocks[Block.dirt.blockID] = true;
canCarryBlocks[Block.sand.blockID] = true;
canCarryBlocks[Block.gravel.blockID] = true;
canCarryBlocks[Block.plantYellow.blockID] = true;
canCarryBlocks[Block.plantRed.blockID] = true;
canCarryBlocks[Block.mushroomBrown.blockID] = true;
canCarryBlocks[Block.mushroomRed.blockID] = true;
canCarryBlocks[Block.tnt.blockID] = true;
canCarryBlocks[Block.cactus.blockID] = true;
canCarryBlocks[Block.blockClay.blockID] = true;
canCarryBlocks[Block.pumpkin.blockID] = true;
canCarryBlocks[Block.melon.blockID] = true;
canCarryBlocks[Block.mycelium.blockID] = true;
}
Bin mir allerdings nicht zu 100% sicher