2) the "classic" method where you simple figure out what you want to do in the updateEntityActionState() method.
The problem with Ghast is that extends EntityFlying which does not extend EntityCreature. So if you just turn on the AI, there won't be any. But unfortunately you can't just add the existing AI types because some of them take EntityCreature as the parameter -- so you'd have to modify them.
So what do you want to do exactly? If it is very close to the Ghast in behavior, you should just look at the updateEntityActionState() that process the Ghast movement.
Lastly, are you sure you want to extend EntityGhast, or extend EntityFlying? If you just want something like a Ghast, then you should really copy the Ghast code rather than extending it. When you extend a class, the subclass is still actually also considered and instance of the superclass -- so any code that checks for Ghast entity might trigger positive on yours. You should only extend and entity if you want to create a variation -- like a cow that is still a cow but behaves slightly differently.
2) the "classic" method where you simple figure out what you want to do in the updateEntityActionState() method.
The problem with Ghast is that extends EntityFlying which does not extend EntityCreature. So if you just turn on the AI, there won't be any. But unfortunately you can't just add the existing AI types because some of them take EntityCreature as the parameter -- so you'd have to modify them.
So what do you want to do exactly? If it is very close to the Ghast in behavior, you should just look at the updateEntityActionState() that process the Ghast movement.
Lastly, are you sure you want to extend EntityGhast, or extend EntityFlying? If you just want something like a Ghast, then you should really copy the Ghast code rather than extending it. When you extend a class, the subclass is still actually also considered and instance of the superclass -- so any code that checks for Ghast entity might trigger positive on yours. You should only extend and entity if you want to create a variation -- like a cow that is still a cow but behaves slightly differently.
I'm not extending EntityGhast, I'm simply using methods from its code.
Yes. You need to understand that there are two ways to do AI:
1) the "new" system that uses an AI task list and cycles through them. If you set isAIEnabled() to return true, this functionality will happen. I have a tutorial on this if you're interested: http://jabelarminecraft.blogspot.com/p/minecraft-forge-1721710-custom-entity-ai.html
2) the "classic" method where you simple figure out what you want to do in the updateEntityActionState() method.
The problem with Ghast is that extends EntityFlying which does not extend EntityCreature. So if you just turn on the AI, there won't be any. But unfortunately you can't just add the existing AI types because some of them take EntityCreature as the parameter -- so you'd have to modify them.
So what do you want to do exactly? If it is very close to the Ghast in behavior, you should just look at the updateEntityActionState() that process the Ghast movement.
Lastly, are you sure you want to extend EntityGhast, or extend EntityFlying? If you just want something like a Ghast, then you should really copy the Ghast code rather than extending it. When you extend a class, the subclass is still actually also considered and instance of the superclass -- so any code that checks for Ghast entity might trigger positive on yours. You should only extend and entity if you want to create a variation -- like a cow that is still a cow but behaves slightly differently.
I'm not extending EntityGhast, I'm simply using methods from its code.
Okay, good. But you still have same problem -- EntityFlying doesn't really have any examples that use the new AI scheme.
What does your AI code look like?