Posted March 29, 201510 yr I've been working on some custom AI for my custom mob (flying penguin), but I've currently run into a snag. I'm trying to set it like so: public boolean shouldExecute() { if (theEntityCreature.worldObj.getClosestPlayerToEntity(theEntityCreature, 3.0D) == null) { return false; } Vec3 vec3 = RandomPositionGenerator.findRandomTarget((EntityCreature) theEntityCreature, 30, 10);//ERROR if (vec3 == null) { return false; } else { randPosX = vec3.xCoord; randPosY = vec3.yCoord; randPosZ = vec3.zCoord; return true; } } It crashes when it reaches the RandomPositonGenerator. What's wrong with it?
March 29, 201510 yr Author Somehow I missed it in the console, but apparently its a class cast exception. I need a way to cast though. RandomPositionGenerator wants an EntityCreature, but I can't seem to cast from EntityPenguinMob (custom entity). How could I get around the cast?
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.