I'm trying to make a custom AI where my custom mob moves to my custom block. I always get this crash report whenever I spawn my Entity. I would post my crash but his website keeps marking it as spam but heres my AI Class
Put your spoiler here.
package Shinobi.Entitys.Entitys.AI;
import Shinobi.Blocks.BlockDeathPos;
import Shinobi.Entitys.Entitys.EntityHidan;
import net.minecraft.entity.EntityCreature;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.entity.ai.RandomPositionGenerator;
import net.minecraft.util.Vec3;
public class AIDeathpos extends EntityAIBase
{
private EntityHidan entityH;
private BlockDeathPos bdp;
private double movePosX;
private double movePosY;
private double movePosZ;
private double speed;
/** If the distance to the block is further than this, this AI task will not run. */
private float maxTargetDistance;
private static final String __OBFID = "CL_00001599";
public AIDeathpos(EntityHidan eh, double spd, float mtd)
{
this.entityH = eh;
this.speed = spd;
this.maxTargetDistance = mtd;
this.setMutexBits(1);
}
/**
* Returns whether the EntityAIBase should begin execution.
*/
public boolean shouldExecute()
{
if (this.bdp.getDistanceSqToEntity(this.entityH) > (double)(this.maxTargetDistance * this.maxTargetDistance))
{
return false;
}
else
{
Vec3 vec3 = RandomPositionGenerator.findRandomTargetBlockTowards(this.entityH, 16, 7, Vec3.createVectorHelper(this.bdp.x, this.bdp.x, this.bdp.x));
if (vec3 == null)
{
return false;
}
else
{
this.movePosX = vec3.xCoord;
this.movePosY = vec3.yCoord;
this.movePosZ = vec3.zCoord;
return true;
}
}
}
/**
* Returns whether an in-progress EntityAIBase should continue executing
*/
public boolean continueExecuting()
{
return true;
}
/**
* Resets the task
*/
public void resetTask()
{
}
/**
* Execute a one shot task or start executing a continuous task
*/
public void startExecuting()
{
this.entityH.getNavigator().tryMoveToXYZ(this.movePosX, this.movePosY, this.movePosZ, this.speed);
}
}
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I'm trying to make a custom AI where my custom mob moves to my custom block. I always get this crash report whenever I spawn my Entity. I would post my crash but his website keeps marking it as spam but heres my AI Class
Put your spoiler here.